From 58186de46453f5d396608a6d3b9602455b51633f Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 30 Jul 2022 04:33:38 +0100 Subject: [PATCH] Create Exceptions --- pywidevine/exceptions.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pywidevine/exceptions.py diff --git a/pywidevine/exceptions.py b/pywidevine/exceptions.py new file mode 100644 index 0000000..682bc93 --- /dev/null +++ b/pywidevine/exceptions.py @@ -0,0 +1,34 @@ +class PyWidevineException(Exception): + """Exceptions used by pywidevine.""" + + +class TooManySessions(PyWidevineException): + """Too many Sessions are open.""" + + +class InvalidSession(PyWidevineException): + """No Session is open with the specified identifier.""" + + +class InvalidInitData(PyWidevineException): + """The Widevine Cenc Header Data is invalid or empty.""" + + +class InvalidLicenseType(PyWidevineException): + """The License Type is an Invalid Value.""" + + +class InvalidLicenseMessage(PyWidevineException): + """The License Message is Invalid or Missing.""" + + +class InvalidContext(PyWidevineException): + """The Context is Invalid or Missing.""" + + +class SignatureMismatch(PyWidevineException): + """The Signature did not match.""" + + +class NoKeysLoaded(PyWidevineException): + """No License was parsed for this Session, No Keys available."""