chargebee 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/chargebee.js +31 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/chargebee.js
CHANGED
|
@@ -8,7 +8,7 @@ ChargeBee._env = {
|
|
|
8
8
|
hostSuffix: '.chargebee.com',
|
|
9
9
|
apiPath: '/api/v2',
|
|
10
10
|
timeout: 80000,
|
|
11
|
-
clientVersion: 'v2.8.
|
|
11
|
+
clientVersion: 'v2.8.1',
|
|
12
12
|
port: 443,
|
|
13
13
|
timemachineWaitInMillis: 3000,
|
|
14
14
|
exportWaitInMillis: 3000
|
|
@@ -191,7 +191,36 @@ ChargeBee._core = (function() {
|
|
|
191
191
|
try {
|
|
192
192
|
response = JSON.parse(response);
|
|
193
193
|
} catch (e) {
|
|
194
|
-
|
|
194
|
+
if (response.includes('503')) {
|
|
195
|
+
return throwError(
|
|
196
|
+
callBack,
|
|
197
|
+
'internal_temporary_error',
|
|
198
|
+
503,
|
|
199
|
+
'internal_temporary_error',
|
|
200
|
+
'Sorry, the server is currently unable to handle the request due to a temporary overload or scheduled maintenance. Please retry after sometime.',
|
|
201
|
+
e
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
else if(response.includes('504')) {
|
|
205
|
+
return throwError(
|
|
206
|
+
callBack,
|
|
207
|
+
'gateway_timeout',
|
|
208
|
+
504,
|
|
209
|
+
'gateway_timeout',
|
|
210
|
+
'The server did not receive a timely response from an upstream server, request aborted. If this problem persists, contact us at support@chargebee.com.',
|
|
211
|
+
e
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
return throwError(
|
|
216
|
+
callBack,
|
|
217
|
+
'internal_error',
|
|
218
|
+
500,
|
|
219
|
+
'internal_error',
|
|
220
|
+
'Sorry, something went wrong when trying to process the request. If this problem persists, contact us at support@chargebee.com.',
|
|
221
|
+
e
|
|
222
|
+
);
|
|
223
|
+
}
|
|
195
224
|
}
|
|
196
225
|
if (res.statusCode < 200 || res.statusCode > 299) {
|
|
197
226
|
response.http_status_code = res.statusCode;
|