Files
boc/vims-backend/node_modules/twilio/lib/base/RestException.js
T
Bernt 6de2455917 v1.2.0: Add Global Markets footer, translated to 9 languages
- Added GLOBAL_MARKETS_TITLE to all translation files
- Updated footer with 12 markets (4 active + 8 upcoming)
- Translated market section to: zh-cn, zh-tw, ja, ko, th, vi, id, ms, hi
- Built and deployed to production
- CloudFront invalidation: I3RTMXVFDJXWLG3SYX208OP1CC
2026-07-08 19:56:03 +00:00

34 lines
1.0 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class RestException extends Error {
constructor(response) {
super("[HTTP " + response.statusCode + "] Failed to execute request");
const isResponseBodyString = typeof response.body == "string";
const body = isResponseBodyString
? parseResponseBody(response.body)
: response.body;
this.status = response.statusCode;
if (body !== null) {
this.message = body.message;
this.code = body.code;
this.moreInfo = body.more_info; /* jshint ignore:line */
this.details = body.details;
}
else {
this.message =
"[HTTP " + response.statusCode + "] Failed to execute request";
}
}
}
exports.default = RestException;
function parseResponseBody(response_body) {
let body = null;
try {
body = JSON.parse(response_body);
}
catch (catchError) {
body = null;
}
return body;
}