File tree 2 files changed +4
-0
lines changed
2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ StripeError.generate = function(rawStripeError) {
57
57
return new _Error . StripeInvalidRequestError ( rawStripeError ) ;
58
58
case 'api_error' :
59
59
return new _Error . StripeAPIError ( rawStripeError ) ;
60
+ case 'idempotency_error' :
61
+ return new _Error . StripeIdempotencyError ( rawStripeError ) ;
60
62
}
61
63
return new _Error ( 'Generic' , 'Unknown Error' ) ;
62
64
} ;
@@ -70,3 +72,4 @@ _Error.StripePermissionError = StripeError.extend({type: 'StripePermissionError'
70
72
_Error . StripeRateLimitError = StripeError . extend ( { type : 'StripeRateLimitError' } ) ;
71
73
_Error . StripeConnectionError = StripeError . extend ( { type : 'StripeConnectionError' } ) ;
72
74
_Error . StripeSignatureVerificationError = StripeError . extend ( { type : 'StripeSignatureVerificationError' } ) ;
75
+ _Error . StripeIdempotencyError = StripeError . extend ( { type : 'StripeIdempotencyError' } ) ;
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ describe('Error', function() {
20
20
Error . StripeInvalidRequestError
21
21
) ;
22
22
expect ( Error . StripeError . generate ( { type : 'api_error' } ) ) . to . be . instanceOf ( Error . StripeAPIError ) ;
23
+ expect ( Error . StripeError . generate ( { type : 'idempotency_error' } ) ) . to . be . instanceOf ( Error . StripeIdempotencyError ) ;
23
24
} ) ;
24
25
25
26
it ( 'Pulls in headers' , function ( ) {
You can’t perform that action at this time.
0 commit comments