PyTrakt icon indicating copy to clipboard operation
PyTrakt copied to clipboard

[python-pytrakt] Feature: Throw BadResponseException on JSON decode errors

Open glensc opened this issue 3 years ago • 4 comments

Many JSONDecodeError (from json module) are actually thrown because trakt.tv site responds with a status code that is not yet recognized by this library:

  • https://github.com/Taxel/PlexTraktSync/issues?q=label%3A%22trakt+support%22+sort%3Aupdated-desc+is%3Aclosed+JSONDecodeError

Add fallback logic to be able to catch this specific error from applications.

Fixes https://github.com/moogar0880/PyTrakt/issues/146

glensc avatar Jan 15 '22 09:01 glensc

Another fresh error:

  • https://github.com/Taxel/PlexTraktSync/issues/431#issuecomment-1013684670

The specific exception would allow to figure out url and status code (.response property).

glensc avatar Jan 15 '22 16:01 glensc

yet another json decode error https://github.com/moogar0880/PyTrakt/pull/194

glensc avatar Jan 23 '22 13:01 glensc

This would be great to have, please merge, thank you!

almightiest avatar May 25 '22 18:05 almightiest

Carried:

  • https://github.com/glensc/python-trakt/commit/827550a0edab5988a713bfe609bb21bd7d504219

glensc avatar Oct 23 '22 13:10 glensc