-
Notifications
You must be signed in to change notification settings - Fork 356
Exception interface #278
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
Exception interface #278
Conversation
@abacaphiliac please rebase on master and push the changes to trigger the TravisCI build |
@bighappyface thanks for having me do that. a couple of my tests did not pass in php53 and php54 because they use JSON constants that aren't available until php55. those 3 tests are now skipped in the php53 and php54 builds. |
@abacaphiliac thanks for the rebase. Would you please now squash these three commits down to one? |
…r adjustment. add \RuntimeException wrapper. update all extensions of \RuntimeException to extend the wrapper. spl-exception wrappers now implement a common exception interface for this package. this allows consumers to handle all custom exception types thrown by catching the common interface rather than by catching each specific extension or their spl parents.
@bighappyface done : ) i haven't tried this myself, but i've read that github now allows the project maintainer to configure squash requirements on merge requests, for a clean history. when enabled, it should give you a dropdown select on for reference: |
@abacaphiliac thanks for squashing down your commits. Unfortunately I can not alter the settings of this repo to enable the squash option; however, while that github feature is nice, I believe a contributor is responsible for the condition of their own branch and PR. I have time set aside next week to add a contributors file to set the appropriate expectations. |
+1 @mirfilip @jojo198 @Maks3w what are your thoughts on this? It looks like @abacaphiliac took the time to setup tests to verify the inclusion of the exception interface and wrapper do not introduce BC-breaking changes and I agree with the common interface approach. Does this look like 2.1.0 material to you? |
public function testDefaultMessage() | ||
{ | ||
$exception = new JsonDecodingException(); | ||
self::assertNotEmpty($exception->getMessage()); |
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.
These series of test are best done as a dataProvider
This can be ok. Anyway:
|
+1 |
\RuntimeException
wrapper.\RuntimeException
to extend the wrapper.\JsonSchema\Constraints\ConstraintInterface
.as a consumer, this change will allow me to handle exceptions from this package like this:
instead of this:
or worse: