We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32a073a commit a628aa7Copy full SHA for a628aa7
lib/reply_error.js
@@ -1,9 +1,16 @@
1
'use strict';
2
3
-module.exports = function ReplyError(message) {
4
- Error.captureStackTrace(this, this.constructor);
+var util = require('util');
+
5
+function ReplyError(message) {
6
this.name = this.constructor.name;
- this.message = message;
7
+ this.message = message || '';
8
9
+ if (Error.captureStackTrace) {
10
+ Error.captureStackTrace(this, this.constructor);
11
+ }
12
};
13
-require('util').inherits(module.exports, Error);
14
+util.inherits(ReplyError, Error);
15
16
+module.exports = ReplyError;
0 commit comments