@intuitionrobotics/thunderstorm
Version:
26 lines • 934 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiException = void 0;
const ts_common_1 = require("@intuitionrobotics/ts-common");
class ApiException extends ts_common_1.CustomException {
setDispatchError(dispatchError) {
this.dispatchError = dispatchError;
return this;
}
getDispatchError() {
return this.dispatchError;
}
constructor(responseCode, debugMessage, cause) {
super(ApiException, `${responseCode}-${JSON.stringify(debugMessage)}`, cause);
this.responseBody = {};
this.dispatchError = true;
this.setErrorBody = (errorBody) => {
this.responseBody.error = errorBody;
return this;
};
this.responseCode = responseCode;
this.responseBody.debugMessage = JSON.stringify(debugMessage);
}
}
exports.ApiException = ApiException;
//# sourceMappingURL=exceptions.js.map