From 2f8bd44687ba54b0f6f299659139086d7bd8aaff Mon Sep 17 00:00:00 2001 From: Hannah Date: Tue, 14 May 2019 18:01:50 +0000 Subject: [PATCH] Added error handling for changes to utils.py --- src/pluralkit/errors.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/pluralkit/errors.py diff --git a/src/pluralkit/errors.py b/src/pluralkit/errors.py old mode 100644 new mode 100755 index ae084adb..cc676928 --- a/src/pluralkit/errors.py +++ b/src/pluralkit/errors.py @@ -45,6 +45,21 @@ class InvalidAvatarURLError(PluralKitError): super().__init__("Invalid image URL.") +class AvatarHTTPError(PluralKitError): + def __init__(self): + super().__init__("Avatar could not be retrieved. ") + + +class InvalidAvatarContentTypeError(PluralKitError): + def __init__(self): + super().__init__("Avatar file type disallowed. (Types: jpg, png, gif)") + + +class AvatarFileSizeTooLargeError(PluralKitError): + def __init__(self): + super().__init__("Avatar file size too large. (Limit: 1MB)") + + class AccountInOwnSystemError(PluralKitError): def __init__(self): super().__init__("That account is already linked to your own system.") @@ -101,4 +116,5 @@ class InvalidTimeZoneError(PluralKitError): class TupperboxImportError(PluralKitError): def __init__(self): - super().__init__("Invalid Tupperbox file.") \ No newline at end of file + super().__init__("Invalid Tupperbox file.") +