statsbombpy icon indicating copy to clipboard operation
statsbombpy copied to clipboard

Raise appropriate error when resource does not exist

Open probberechts opened this issue 4 years ago • 0 comments

When trying to retrieve a resource which does not exist, statsbombpy throws a JSONDecodeError. Example:

>> from statsbombpy import sb
>> sb.events(1234)
JSONDecodeError: Extra data: line 1 column 4 (char 3)

To help users understand what went wrong, it would be more appropriate to throw a ResourceNotFoundError (or something alike).

probberechts avatar Dec 30 '21 11:12 probberechts