From e0ccdd15fcee179b523fc6254398d934d802517f Mon Sep 17 00:00:00 2001 From: Barney Hanlon <445227+shrikeh@users.noreply.github.com> Date: Tue, 18 Oct 2022 11:11:53 +0100 Subject: [PATCH] Add exception interface for easier catching without having to intimately know the library --- src/InvalidPostcodeException.php | 2 +- src/PostcodeException.php | 9 +++++++++ src/UnknownCountryException.php | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/PostcodeException.php diff --git a/src/InvalidPostcodeException.php b/src/InvalidPostcodeException.php index 629f70c..c3785ec 100644 --- a/src/InvalidPostcodeException.php +++ b/src/InvalidPostcodeException.php @@ -7,6 +7,6 @@ /** * Exception thrown when trying to format an invalid postcode. */ -class InvalidPostcodeException extends \Exception +class InvalidPostcodeException extends \Exception implements PostcodeException { } diff --git a/src/PostcodeException.php b/src/PostcodeException.php new file mode 100644 index 0000000..e1dc5f3 --- /dev/null +++ b/src/PostcodeException.php @@ -0,0 +1,9 @@ +