Skip to content

Commit db717b7

Browse files
committed
Adds support for code to ApplicationErrors
1 parent acdac37 commit db717b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/utils/createApplicationErrorClass.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
* the application.
44
*/
55
export class ApplicationError extends Error {
6-
constructor(message) {
6+
constructor(message, extra = {}) {
77
super();
88
if (Error.captureStackTrace) {
99
Error.captureStackTrace(this, this.constructor);
1010
}
1111
this.name = 'ApplicationError';
1212
this.message = message;
13+
this.code = extra.code;
1314
}
1415
}
1516

0 commit comments

Comments
 (0)