@inv2/common
Version:
A common module for v2
19 lines (18 loc) • 891 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatabaseConnectionError = void 0;
const custom_error_1 = require("./custom-error");
const http_status_1 = __importDefault(require("http-status"));
class DatabaseConnectionError extends custom_error_1.CustomError {
constructor(params = { code: http_status_1.default.INTERNAL_SERVER_ERROR, message: `An unexpected error occured on the DB while processing request` }) {
super(params);
// Add this because we are extending a built in class
Object.setPrototypeOf(this, DatabaseConnectionError.prototype);
this.code = params.code;
this.message = params.message;
}
}
exports.DatabaseConnectionError = DatabaseConnectionError;