Skip to content

Commit 89d117b

Browse files
committed
Added custom ErrorResponse class
1 parent c828419 commit 89d117b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/ErrorResponse.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class ErrorResponse extends Error {
2+
constructor(message, statusCode) {
3+
super(message);
4+
this.statusCode = statusCode;
5+
6+
Error.captureStackTrace(this, this.constructor);
7+
}
8+
}
9+
10+
module.exports = ErrorResponse;

0 commit comments

Comments
 (0)