-
Notifications
You must be signed in to change notification settings - Fork 46
Base exception #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base exception #67
Conversation
I would be happier with a marker interface. |
But you cant catch an interface, right? Or can you? If so, an interface is way better. try {
$client = HttpClientDiscovery::find()
} catch(DiscoveryExceptionInterface $e) {
// log
} |
Of course you can. As long as the implementation extends |
Cool, thank you. I've updated the PR. |
namespace Http\Discovery; | ||
|
||
/** | ||
* An interface implemented by all our exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exceptionS
Can you please add a changelog entry too? (You might need to rebase your branch though, I added change logs in the master as well) |
PR updated. |
namespace Http\Discovery; | ||
|
||
/** | ||
* An interface implemented by all our exceptions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/by all our/by all discovery related/
dfc0056
to
400e1a5
Compare
Rebased and squashed. |
Thank you for merging. |
Writing #66 made me think of introducing a base exception that all our exception extends from. This will make it easier to catch a discovery exception in case something goes wrong.
This will be extra relevant if #66 gets merged because it introduces another exception.