summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Alvares Gomes <lucasagomes@gmail.com>2014-04-07 14:28:51 +0100
committerLucas Alvares Gomes <lucasagomes@gmail.com>2014-04-07 14:28:51 +0100
commit32177f13481878e044b6748065efb0adc84c24a6 (patch)
tree72c7a43d906fd033a5fa89fd467fe3af26c35d00
parentd725141a0d5bbd0f9446cc9e3820ccd2ff78cbcd (diff)
downloadpython-json-patch-32177f13481878e044b6748065efb0adc84c24a6.tar.gz
Improve error message when removing non-existent objects
-rw-r--r--jsonpatch.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index a46c9b0..d23e5a2 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -399,7 +399,8 @@ class RemoveOperation(PatchOperation):
try:
del subobj[part]
except IndexError as ex:
- raise JsonPatchConflict(str(ex))
+ msg = "can't remove non-existent object '{0}'".format(part)
+ raise JsonPatchConflict(msg)
return obj