@intuitionrobotics/thunderstorm
Version:
24 lines • 796 B
JavaScript
import { CustomException } from "@intuitionrobotics/ts-common";
import {} from "../index.js";
export class ApiException extends CustomException {
responseBody = {};
responseCode;
dispatchError = true;
setErrorBody = (errorBody) => {
this.responseBody.error = errorBody;
return this;
};
setDispatchError(dispatchError) {
this.dispatchError = dispatchError;
return this;
}
getDispatchError() {
return this.dispatchError;
}
constructor(responseCode, debugMessage, cause) {
super(ApiException, `${responseCode}-${JSON.stringify(debugMessage)}`, cause);
this.responseCode = responseCode;
this.responseBody.debugMessage = JSON.stringify(debugMessage);
}
}
//# sourceMappingURL=exceptions.js.map