UNPKG

@inv2/common

Version:

A common module for v2

19 lines (18 loc) 785 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NotFoundError = void 0; const custom_error_1 = require("./custom-error"); const http_status_1 = __importDefault(require("http-status")); class NotFoundError extends custom_error_1.CustomError { constructor(params = { code: http_status_1.default.NOT_FOUND, message: `Resource not found` }) { super(params); // Add this because we are extending a built in class Object.setPrototypeOf(this, NotFoundError.prototype); this.code = params.code; this.message = params.message; } } exports.NotFoundError = NotFoundError;