import { ErrorNumber } from "./types" ; /**
 * Merror Constructor extending JS Error object
 */ class Merror extends Error { isHttpError : boolean ; statusCode : ErrorNumber ; message : string ; properties : object ; param { ErrorNumber } statusCode param { string } message param { object } properties param { Array < any > } params extends Error constructor ( statusCode , message = "" , properties = { } , ... params ) { super ( ... params ) ; if ( Error . captureStackTrace ) { Error . captureStackTrace ( this , Merror ) ; } this . isHttpError = true ; this . statusCode = statusCode || 500 ; this . message = message ; this . properties = properties ; } } export default Merror ;