2016-03-21 00:26:02 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
2014-12-28 22:21:58 -05:00
|
|
|
|
2017-02-20 00:37:00 -05:00
|
|
|
|
2016-10-19 11:39:18 -04:00
|
|
|
class PlexApiException(Exception):
|
2017-01-23 00:15:51 -05:00
|
|
|
""" Base class for all PlexAPI exceptions. """
|
2014-12-28 22:21:58 -05:00
|
|
|
pass
|
|
|
|
|
2017-02-20 00:37:00 -05:00
|
|
|
|
2016-10-19 11:39:18 -04:00
|
|
|
class BadRequest(PlexApiException):
|
2017-01-23 00:15:51 -05:00
|
|
|
""" An invalid request, generally a user error. """
|
2014-12-28 22:21:58 -05:00
|
|
|
pass
|
|
|
|
|
2017-02-20 00:37:00 -05:00
|
|
|
|
2016-10-19 11:39:18 -04:00
|
|
|
class NotFound(PlexApiException):
|
2017-01-23 00:15:51 -05:00
|
|
|
""" Request media item or device is not found. """
|
2014-12-28 22:21:58 -05:00
|
|
|
pass
|
|
|
|
|
2017-02-20 00:37:00 -05:00
|
|
|
|
2016-10-19 11:39:18 -04:00
|
|
|
class UnknownType(PlexApiException):
|
2017-01-23 00:15:51 -05:00
|
|
|
""" Unknown library type. """
|
2014-12-28 22:21:58 -05:00
|
|
|
pass
|
2015-02-23 22:42:29 -05:00
|
|
|
|
2017-02-20 00:37:00 -05:00
|
|
|
|
2016-10-19 11:39:18 -04:00
|
|
|
class Unsupported(PlexApiException):
|
2017-01-23 00:15:51 -05:00
|
|
|
""" Unsupported client request. """
|
2016-10-19 11:39:18 -04:00
|
|
|
pass
|
|
|
|
|
2017-02-20 00:37:00 -05:00
|
|
|
|
2020-04-09 15:56:26 -05:00
|
|
|
class Unauthorized(BadRequest):
|
|
|
|
""" Invalid username/password or token. """
|
2015-02-23 22:42:29 -05:00
|
|
|
pass
|
2024-02-17 14:34:43 -08:00
|
|
|
|
|
|
|
|
|
|
|
class TwoFactorRequired(Unauthorized):
|
|
|
|
""" Two factor authentication required. """
|
|
|
|
pass
|