@@ -11,13 +11,14 @@ class SellingApiException(Exception):
1111 """
1212 code = 999
1313
14- def __init__ (self , error ):
14+ def __init__ (self , error , headers ):
1515 try :
1616 self .message = error [0 ].get ('message' )
1717 self .amzn_code = error [0 ].get ('code' )
1818 except IndexError :
1919 pass
2020 self .error = error
21+ self .headers = headers
2122
2223
2324class SellingApiBadRequestException (SellingApiException ):
@@ -26,8 +27,8 @@ class SellingApiBadRequestException(SellingApiException):
2627 """
2728 code = 400
2829
29- def __init__ (self , error ):
30- super (SellingApiBadRequestException , self ).__init__ (error )
30+ def __init__ (self , error , headers = None ):
31+ super (SellingApiBadRequestException , self ).__init__ (error , headers )
3132
3233
3334class SellingApiForbiddenException (SellingApiException ):
@@ -36,8 +37,8 @@ class SellingApiForbiddenException(SellingApiException):
3637 """
3738 code = 403
3839
39- def __init__ (self , error ):
40- super (SellingApiForbiddenException , self ).__init__ (error )
40+ def __init__ (self , error , headers = None ):
41+ super (SellingApiForbiddenException , self ).__init__ (error , headers )
4142
4243
4344class SellingApiNotFoundException (SellingApiException ):
@@ -46,8 +47,8 @@ class SellingApiNotFoundException(SellingApiException):
4647 """
4748 code = 404
4849
49- def __init__ (self , error ):
50- super (SellingApiNotFoundException , self ).__init__ (error )
50+ def __init__ (self , error , headers = None ):
51+ super (SellingApiNotFoundException , self ).__init__ (error , headers )
5152
5253
5354class SellingApiRequestThrottledException (SellingApiException ):
@@ -56,8 +57,8 @@ class SellingApiRequestThrottledException(SellingApiException):
5657 """
5758 code = 429
5859
59- def __init__ (self , error ):
60- super (SellingApiRequestThrottledException , self ).__init__ (error )
60+ def __init__ (self , error , headers = None ):
61+ super (SellingApiRequestThrottledException , self ).__init__ (error , headers )
6162
6263
6364class SellingApiServerException (SellingApiException ):
@@ -66,8 +67,8 @@ class SellingApiServerException(SellingApiException):
6667 """
6768 code = 500
6869
69- def __init__ (self , error ):
70- super (SellingApiServerException , self ).__init__ (error )
70+ def __init__ (self , error , headers = None ):
71+ super (SellingApiServerException , self ).__init__ (error , headers )
7172
7273
7374class SellingApiTemporarilyUnavailableException (SellingApiException ):
@@ -76,8 +77,8 @@ class SellingApiTemporarilyUnavailableException(SellingApiException):
7677 """
7778 code = 503
7879
79- def __init__ (self , error ):
80- super (SellingApiTemporarilyUnavailableException , self ).__init__ (error )
80+ def __init__ (self , error , headers = None ):
81+ super (SellingApiTemporarilyUnavailableException , self ).__init__ (error , headers )
8182
8283
8384def get_exception_for_code (code : int ):
0 commit comments