From 32177f13481878e044b6748065efb0adc84c24a6 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Mon, 7 Apr 2014 14:28:51 +0100 Subject: Improve error message when removing non-existent objects --- jsonpatch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1