open-contracting-archive / toucan

A web interface to OCDS Kit and Flatten Tool
https://toucan.open-contracting.org
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

JsonRefError: Unresolvable JSON pointer: '/definitions/MilestoneReference' #91

Open sentry-io[bot] opened 4 years ago

sentry-io[bot] commented 4 years ago

If a user uploads a schema with unresolvable JSON pointers, then the app will error. We can add error handling for the `get_mapping_sheetfrom* methods.

Sentry Issue: OPEN-CONTRACTING-TOUCAN-W

AttributeError: 'JsonRef' object has no attribute 'cache'
  File "proxytypes.py", line 252, in __subject__
    return self.cache
  File "proxytypes.py", line 176, in __getattribute__
    return _oga(self, attr)

KeyError: 'MilestoneReference'
  File "jsonref.py", line 217, in resolve_pointer
    document = document[part]

JsonRefError: Unresolvable JSON pointer: '/definitions/MilestoneReference'
(20 additional frame(s) were not displayed)
...
  File "jsonref.py", line 174, in callback
    result = self.resolve_pointer(self.store[uri], fragment)
  File "proxytypes.py", line 134, in wrapper
    return method(self, *args, **kwargs)
  File "jsonref.py", line 219, in resolve_pointer
    self._error("Unresolvable JSON pointer: %r" % pointer, cause=e)
  File "proxytypes.py", line 134, in wrapper
    return method(self, *args, **kwargs)
  File "jsonref.py", line 229, in _error
    cause=cause,
sentry-io[bot] commented 4 years ago

Sentry issue: OPEN-CONTRACTING-TOUCAN-X