Skip to content

Conversation

@shrikeh
Copy link

@shrikeh shrikeh commented Oct 18, 2022

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
    );      
}

@BenMorel
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants