@saysimple/node-sdk
Version:
The official SaySimple Node SDK. Want to use our awesome customer conversations platform? Please visit: https://saysimple.com
24 lines (23 loc) • 727 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Response = void 0;
var http_client_error_1 = require("./error/http-client-error");
var Response = /** @class */ (function () {
function Response(statusCode, body) {
this.statusCode = statusCode;
this.bodyRaw = body;
if (typeof body === "string" && body.length > 0) {
try {
this.body = JSON.parse(body);
}
catch (e) {
throw new http_client_error_1.HttpClientError(1003, "Trouble parsing response", "TBD");
}
}
else {
this.body = body;
}
}
return Response;
}());
exports.Response = Response;