Snai3i-LandingPage-FormBuilder / backend / src / utils / errorHandler.ts
errorHandler.ts
Raw
class ErrorHandler extends Error {
	constructor(public message: string, public statusCode: number) {
		super(message);
		this.statusCode = statusCode;
		this.name = this.constructor.name;
		Error.captureStackTrace(this, this.constructor);
	}
}

export default ErrorHandler;