Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added common superclass to exceptions. #5

Closed
wants to merge 2 commits into from

2 participants

@codeinthehole

It can be useful to catch both forms of exception in some circumstances, where you don't care about which one it actually was. Plus, when you have payments going on with lots of different partners, it can be useful to determine which partner the exception came from. Having a common superclass can help.

@alexjg

Between the time you opened this and corrected the typo I also fixed it and committed so will have to close this pull request, thanks for the request though.

@alexjg alexjg closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 gocardless/exceptions.py
View
8 gocardless/exceptions.py
@@ -1,8 +1,12 @@
+class GoCardlessError(Exception):
+ pass
+
-class ClientError(Exception):
+class ClientError(GoCardlessError):
"""Thrown when there was an error processing the request"""
pass
-class SignatureError(Exception):
+
+class SignatureError(GoCardlessError):
pass
Something went wrong with that request. Please try again.