Catch KeyError when accessing the sub-doc items

In [12]: doc = {'param1': 1, 'param2': {'oi' :'ola'}}
In [13]: patch = [{'op': 'remove', 'path': '/invalid'}]
In [14]: jsonpatch.apply_patch(doc, jsonpatch.JsonPatch(patch))
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-14-4533e42f88c2> in <module>()
----> 1 jsonpatch.apply_patch(doc, jsonpatch.JsonPatch(patch))

/usr/lib/python2.7/site-packages/jsonpatch.pyc in apply_patch(doc, patch, in_place)
    139     else:
    140         patch = JsonPatch(patch)
--> 141     return patch.apply(doc, in_place)
    142 
    143 def make_patch(src, dst):

/usr/lib/python2.7/site-packages/jsonpatch.pyc in apply(self, obj, in_place)
    342 
    343         for operation in self._ops:
--> 344             obj = operation.apply(obj)
    345 
    346         return obj

/usr/lib/python2.7/site-packages/jsonpatch.pyc in apply(self, obj)
    393         subobj, part = self.pointer.to_last(obj)
    394         try:
--> 395             del subobj[part]
    396         except IndexError as ex:
    397             raise JsonPatchConflict(str(ex))