We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc97b62 commit b16e485Copy full SHA for b16e485
test/parallel/test-errors-systemerror.js
@@ -111,3 +111,25 @@ const { ERR_TEST } = codes;
111
assert.strictEqual(err.path, 'path');
112
assert.strictEqual(err.dest, 'path');
113
}
114
+
115
+{
116
+ const ctx = {
117
+ code: 'ERR_TEST',
118
+ message: 'Error occurred',
119
+ syscall: 'syscall_test'
120
+ };
121
+ assert.throws(
122
+ () => {
123
+ const err = new ERR_TEST(ctx);
124
+ err.name = 'SystemError [CUSTOM_ERR_TEST]';
125
+ throw err;
126
+ },
127
+ {
128
129
+ name: 'SystemError [CUSTOM_ERR_TEST]',
130
+ message: 'custom message: syscall_test returned ERR_TEST ' +
131
+ '(Error occurred)',
132
+ info: ctx
133
+ }
134
+ );
135
+}
0 commit comments