Skip to content

Commit

Permalink
Merge pull request #168 from elisaherold/master
Browse files Browse the repository at this point in the history
Add get methods for fields in `JsonPatchApplicationException`
  • Loading branch information
holograph authored Feb 6, 2023
2 parents f80882c + 93a6b40 commit 0c9d7d4
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@
* Date: 03/08/16
*/
public class JsonPatchApplicationException extends RuntimeException {
Operation operation;
JsonPointer path;
final Operation operation;
final JsonPointer path;

public JsonPatchApplicationException(String message, Operation operation, JsonPointer path) {
super(message);
this.operation = operation;
this.path = path;
}

public Operation getOperation() {
return operation;
}

public JsonPointer getPath() {
return path;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand All @@ -38,4 +46,5 @@ public String toString() {
if (path != null) sb.append(" at ").append(path.isRoot() ? "root" : path);
return sb.toString();
}

}

0 comments on commit 0c9d7d4

Please sign in to comment.