diff options
author | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2014-04-07 14:28:51 +0100 |
---|---|---|
committer | Lucas Alvares Gomes <lucasagomes@gmail.com> | 2014-04-07 14:28:51 +0100 |
commit | 32177f13481878e044b6748065efb0adc84c24a6 (patch) | |
tree | 72c7a43d906fd033a5fa89fd467fe3af26c35d00 /jsonpatch.py | |
parent | d725141a0d5bbd0f9446cc9e3820ccd2ff78cbcd (diff) | |
download | python-json-patch-32177f13481878e044b6748065efb0adc84c24a6.tar.gz |
Improve error message when removing non-existent objects
Diffstat (limited to 'jsonpatch.py')
-rw-r--r-- | jsonpatch.py | 3 |
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 |