| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1698c8e commit 1a452f1
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,7 @@ function newHandle(type) { | |||
| 79 | 79 | return handle; | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | - throw new errors.Error('ERR_SOCKET_BAD_TYPE'); | ||
| 82 | + throw new errors.TypeError('ERR_SOCKET_BAD_TYPE'); | ||
| 83 | 83 | } | |
| 84 | 84 | ||
| 85 | 85 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -181,7 +181,7 @@ function setupKillAndExit() { | |||
| 181 | 181 | if (lazyConstants()[sig]) { | |
| 182 | 182 | err = process._kill(pid, lazyConstants()[sig]); | |
| 183 | 183 | } else { | |
| 184 | - throw new errors.Error('ERR_UNKNOWN_SIGNAL', `${sig}`); | ||
| 184 | + throw new errors.TypeError('ERR_UNKNOWN_SIGNAL', sig); | ||
| 185 | 185 | } | |
| 186 | 186 | } | |
| 187 | 187 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,7 +180,7 @@ function convertToValidSignal(signal) { | |||
| 180 | 180 | if (signalName) return signalName; | |
| 181 | 181 | } | |
| 182 | 182 | ||
| 183 | - throw new errors.Error('ERR_UNKNOWN_SIGNAL', signal); | ||
| 183 | + throw new errors.TypeError('ERR_UNKNOWN_SIGNAL', signal); | ||
| 184 | 184 | } | |
| 185 | 185 | ||
| 186 | 186 | function getConstructorOf(obj) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,6 +68,6 @@ assert(Number.isInteger(child.pid)); | |||
| 68 | 68 | // try killing with invalid signal | |
| 69 | 69 | assert.throws(() => { | |
| 70 | 70 | child.kill('foo'); | |
| 71 | - }, common.expectsError({ code: 'ERR_UNKNOWN_SIGNAL' })); | ||
| 71 | + }, common.expectsError({ code: 'ERR_UNKNOWN_SIGNAL', type: TypeError })); | ||
| 72 | 72 | ||
| 73 | 73 | assert.strictEqual(child.kill(), true); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ if (process.argv[2] === 'child') { | |||
| 31 | 31 | // Verify that an error is thrown for unknown signals. | |
| 32 | 32 | assert.throws(() => { | |
| 33 | 33 | spawn('SIG_NOT_A_REAL_SIGNAL'); | |
| 34 | - }, common.expectsError({ code: 'ERR_UNKNOWN_SIGNAL' })); | ||
| 34 | + }, common.expectsError({ code: 'ERR_UNKNOWN_SIGNAL', type: TypeError })); | ||
| 35 | 35 | ||
| 36 | 36 | // Verify that the default kill signal is SIGTERM. | |
| 37 | 37 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -186,7 +186,7 @@ if (!common.isWindows) { | |||
| 186 | 186 | // Validate the killSignal option | |
| 187 | 187 | const typeErr = /^TypeError: "killSignal" must be a string or number$/; | |
| 188 | 188 | const unknownSignalErr = | |
| 189 | - common.expectsError({ code: 'ERR_UNKNOWN_SIGNAL' }); | ||
| 189 | + common.expectsError({ code: 'ERR_UNKNOWN_SIGNAL', type: TypeError }); | ||
| 190 | 190 | ||
| 191 | 191 | pass('killSignal', undefined); | |
| 192 | 192 | pass('killSignal', null); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ invalidTypes.forEach((invalidType) => { | |||
| 27 | 27 | dgram.createSocket(invalidType); | |
| 28 | 28 | }, common.expectsError({ | |
| 29 | 29 | code: 'ERR_SOCKET_BAD_TYPE', | |
| 30 | - type: Error, | ||
| 30 | + type: TypeError, | ||
| 31 | 31 | message: errMessage | |
| 32 | 32 | })); | |
| 33 | 33 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,7 +60,7 @@ assert.throws(function() { process.kill(-1 / 0); }, | |||
| 60 | 60 | // Test that kill throws an error for invalid signal | |
| 61 | 61 | const unknownSignal = common.expectsError({ | |
| 62 | 62 | code: 'ERR_UNKNOWN_SIGNAL', | |
| 63 | - type: Error, | ||
| 63 | + type: TypeError, | ||
| 64 | 64 | message: 'Unknown signal: test' | |
| 65 | 65 | }); | |
| 66 | 66 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments