From 421a7c29993b60b4a1c851dee7418159d9293445 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 22 2015 08:49:23 +0000 Subject: Add the APIError class thrown by the API when something goes wrong --- diff --git a/pagure/exceptions.py b/pagure/exceptions.py index 4114069..3b95fdc 100644 --- a/pagure/exceptions.py +++ b/pagure/exceptions.py @@ -28,3 +28,12 @@ class FileNotFoundException(PagureException): exists. ''' pass + + +class APIError(PagureException): + ''' Exception raised by the API when something goes wrong. ''' + + def __init__(self, status_code, error_code, error=None): + self.status_code = status_code + self.error_code = error_code + self.error = error