Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cast error code as int, update comments to elaborate on what PayPalEr…

…ror exception is.
  • Loading branch information...
commit ca6018783c5545d34750d6018e35e67e518bfb3a 1 parent 4ab375a
@gtaylor gtaylor authored committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 paypal/exceptions.py
View
6 paypal/exceptions.py
@@ -5,7 +5,9 @@
class PayPalError(Exception):
"""
- Used to denote some kind of generic error.
+ Used to denote some kind of generic error. This does not include errors
+ returned from PayPal API responses. Those are handled by the more
+ specific exception classes below.
"""
def __init__(self, message, error_code=None):
self.response = message
@@ -34,7 +36,7 @@ class PayPalAPIResponseError(PayPalError):
"""
def __init__(self, response):
self.response = response
- self.error_code = response.L_ERRORCODE0
+ self.error_code = int(response.L_ERRORCODE0)
self.message = response.L_LONGMESSAGE0
self.short_message = response.L_SHORTMESSAGE0
self.correlation_id = response.CORRELATIONID
Please sign in to comment.
Something went wrong with that request. Please try again.