Skip to content
Browse files

More granular exceptions, fixes #9

  • Loading branch information...
1 parent ffe105f commit 335b0cf7991b8f9e389991ef99db4b76e9486534 @coleifer coleifer committed Oct 8, 2012
Showing with 5 additions and 2 deletions.
  1. +3 −0 micawber/exceptions.py
  2. +2 −2 micawber/providers.py
View
3 micawber/exceptions.py
@@ -1,2 +1,5 @@
class ProviderException(Exception):
pass
+
+class ProviderNotFoundException(ProviderException):
+ pass
View
4 micawber/providers.py
@@ -10,7 +10,7 @@
except ImportError:
import json
-from micawber.exceptions import ProviderException
+from micawber.exceptions import ProviderException, ProviderNotFoundException
class Provider(object):
@@ -108,7 +108,7 @@ def request(self, url, **params):
provider = self.provider_for_url(url)
if provider:
return provider.request(url, **params)
- raise ProviderException('Provider not found for "%s"' % url)
+ raise ProviderNotFoundException('Provider not found for "%s"' % url)
def bootstrap_basic(cache=None):

0 comments on commit 335b0cf

Please sign in to comment.
Something went wrong with that request. Please try again.