Skip to content

Commit 32177f1

Browse files
committed
Improve error message when removing non-existent objects
1 parent d725141 commit 32177f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jsonpatch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ def apply(self, obj):
399399
try:
400400
del subobj[part]
401401
except IndexError as ex:
402-
raise JsonPatchConflict(str(ex))
402+
msg = "can't remove non-existent object '{0}'".format(part)
403+
raise JsonPatchConflict(msg)
403404

404405
return obj
405406

0 commit comments

Comments
 (0)