-
Notifications
You must be signed in to change notification settings - Fork 11
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
Throw new exception type when test operation fails #22
Comments
Hi, thanks for the issue. I think this is great enhancement to this library but it needs to be done in the next major release to avoid breaking change |
Actually we could just extend the new exception type ( |
Isn't it a breaking change? If you currently catch the JsonPatchException, will it also catch it if the exception is of type JsonPatchTestOperationException? |
yes. they both inherit from the same type, but you can also explicitly catch |
So I just updated to v3, but when I call Stacktrace:
|
It seems to come from this:
|
This should work now in 3.0.1 |
For me it's not there yet. I have a unit test which tests a patch operation with a path that does not exist, I would assume it doesn't throw a |
Ok, I need to check that |
Currently it's hard to distinguish between a failing test operation and other apply issues, because they all throw a
JsonPatchException
.I would like to return a
409 Conflict
http status when a test operation fails, but the only way to identify this is by catching the exception and check if the message contains" is not equal to the test value "
.It would be nice if an exception of another type was thrown, for example a
JsonPatchTestOperationException
.The text was updated successfully, but these errors were encountered: