postcode
postcode copied to clipboard
Add exception interface for easier catching without having to intimately know the library
Simple interface applied to all exceptions, allowing code such as:
...
use Brick\Postcode\PostcodeException;
try {
$postcodeFormatter->format('GB', $invalidPostcode);
} catch (PostcodeException $e) {
throw new ApplicationSpecificException(
sprintf('There was a problem with formatting the postcode "%s"', $invalidPostcode),
0,
$e
);
}
Hi, I guess you can just make PostcodeException
the base class as none of the existing exceptions need to extend a particular base class at the moment?