zjsonpatch icon indicating copy to clipboard operation
zjsonpatch copied to clipboard

Enhancement: throw dedicated exception for a test operation failure

Open turing85 opened this issue 11 months ago • 1 comments

Currently, when a test operation fails, a JsonPatchApplicationException is thrown. This makes it hard to distinguish an input error (e.g. referencing a nonexisting path) from a failed test (it is possible by parsing the message, but a separation by exception types would be easier). The new exception type could be a subtype of JsonPatchApplicationException.

Story: AS a developer WHEN a test operation fails THEN I want to receive a dedicated exception signaling that the test path has not the excpected value so I can distinguish between a syntactical error (like a wrong path) and a failed expectation.

turing85 avatar Jan 11 '25 00:01 turing85

I have taken a look at all depentent repositories (github.com) with 100+ stars (and activity in the last 5 years). None of them should be affected when we create a new exception that inherits from JsonPatchApplicationException.

turing85 avatar Jan 11 '25 01:01 turing85