summaryrefslogtreecommitdiff
path: root/app/lib/flickr_api/flickrerrors.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib/flickr_api/flickrerrors.py')
-rw-r--r--app/lib/flickr_api/flickrerrors.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/lib/flickr_api/flickrerrors.py b/app/lib/flickr_api/flickrerrors.py
new file mode 100644
index 0000000..9c0b402
--- /dev/null
+++ b/app/lib/flickr_api/flickrerrors.py
@@ -0,0 +1,34 @@
+""" Base Exception classes
+
+"""
+
+
+class FlickrError(Exception):
+ """Base Exception class
+ """
+ pass
+
+
+class FlickrAPIError(FlickrError):
+ """ Exception for Flickr API Errors
+
+ Parameters:
+ -----------
+ code: int
+ Error code
+ message: str
+ Error message
+ """
+ def __init__(self, code, message):
+ """Constructor
+
+ Parameters:
+ -----------
+ code: int
+ Error code
+ message: str
+ Error message
+ """
+ FlickrError.__init__(self, "%i : %s" % (code, message))
+ self.code = code
+ self.message = message