| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ common.expectsError( | |||
| 36 | 36 | }, ''), | |
| 37 | 37 | { | |
| 38 | 38 | code: 'ERR_INVALID_OPT_VALUE', | |
| 39 | - type: Error, | ||
| 39 | + type: TypeError, | ||
| 40 | 40 | message: 'The value "undefined" is invalid for option "padding"' | |
| 41 | 41 | }); | |
| 42 | 42 | ||
@@ -47,7 +47,7 @@ common.expectsError( | |||
| 47 | 47 | }, ''), | |
| 48 | 48 | { | |
| 49 | 49 | code: 'ERR_INVALID_OPT_VALUE', | |
| 50 | - type: Error, | ||
| 50 | + type: TypeError, | ||
| 51 | 51 | message: 'The value "undefined" is invalid for option "saltLength"' | |
| 52 | 52 | }); | |
| 53 | 53 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,13 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | if (!common.hasCrypto) | |
| 5 | 6 | common.skip('missing crypto'); | |
| 6 | 7 | ||
| 7 | 8 | const http = require('http'); | |
| 8 | 9 | const http2 = require('http2'); | |
| 10 | + const { NghttpError } = require('internal/http2/util'); | ||
| 9 | 11 | ||
| 10 | 12 | // Creating an http1 server here... | |
| 11 | 13 | const server = http.createServer(common.mustNotCall()); | |
@@ -18,13 +20,14 @@ server.listen(0, common.mustCall(() => { | |||
| 18 | 20 | ||
| 19 | 21 | req.on('error', common.expectsError({ | |
| 20 | 22 | code: 'ERR_HTTP2_ERROR', | |
| 21 | - type: Error, | ||
| 23 | + type: NghttpError, | ||
| 22 | 24 | message: 'Protocol error' | |
| 23 | 25 | })); | |
| 24 | 26 | ||
| 25 | 27 | client.on('error', common.expectsError({ | |
| 26 | 28 | code: 'ERR_HTTP2_ERROR', | |
| 27 | - type: Error, | ||
| 29 | + type: NghttpError, | ||
| 30 | + name: 'Error [ERR_HTTP2_ERROR]', | ||
| 28 | 31 | message: 'Protocol error' | |
| 29 | 32 | })); | |
| 30 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | if (!common.hasCrypto) | |
@@ -10,6 +11,7 @@ const { | |||
| 10 | 11 | nghttp2ErrorString | |
| 11 | 12 | } = process.binding('http2'); | |
| 12 | 13 | const http2 = require('http2'); | |
| 14 | + const { NghttpError } = require('internal/http2/util'); | ||
| 13 | 15 | ||
| 14 | 16 | // tests error handling within requestOnConnect | |
| 15 | 17 | // - NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE (should emit session error) | |
@@ -51,7 +53,8 @@ const genericTests = Object.getOwnPropertyNames(constants) | |||
| 51 | 53 | ngError: constants[key], | |
| 52 | 54 | error: { | |
| 53 | 55 | code: 'ERR_HTTP2_ERROR', | |
| 54 | - type: Error, | ||
| 56 | + type: NghttpError, | ||
| 57 | + name: 'Error [ERR_HTTP2_ERROR]', | ||
| 55 | 58 | message: nghttp2ErrorString(constants[key]) | |
| 56 | 59 | }, | |
| 57 | 60 | type: 'session' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | if (!common.hasCrypto) | |
@@ -9,6 +10,7 @@ const { | |||
| 9 | 10 | Http2Stream, | |
| 10 | 11 | nghttp2ErrorString | |
| 11 | 12 | } = process.binding('http2'); | |
| 13 | + const { NghttpError } = require('internal/http2/util'); | ||
| 12 | 14 | ||
| 13 | 15 | // tests error handling within additionalHeaders | |
| 14 | 16 | // - every other NGHTTP2 error from binding (should emit stream error) | |
@@ -24,7 +26,8 @@ const genericTests = Object.getOwnPropertyNames(constants) | |||
| 24 | 26 | ngError: constants[key], | |
| 25 | 27 | error: { | |
| 26 | 28 | code: 'ERR_HTTP2_ERROR', | |
| 27 | - type: Error, | ||
| 29 | + type: NghttpError, | ||
| 30 | + name: 'Error [ERR_HTTP2_ERROR]', | ||
| 28 | 31 | message: nghttp2ErrorString(constants[key]) | |
| 29 | 32 | }, | |
| 30 | 33 | type: 'stream' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | ||
@@ -7,6 +8,7 @@ if (!common.hasCrypto) | |||
| 7 | 8 | ||
| 8 | 9 | const h2 = require('http2'); | |
| 9 | 10 | const net = require('net'); | |
| 11 | + const { NghttpError } = require('internal/http2/util'); | ||
| 10 | 12 | const h2test = require('../common/http2'); | |
| 11 | 13 | let client; | |
| 12 | 14 | ||
@@ -25,7 +27,7 @@ server.on('stream', common.mustCall((stream) => { | |||
| 25 | 27 | server.on('session', common.mustCall((session) => { | |
| 26 | 28 | session.on('error', common.expectsError({ | |
| 27 | 29 | code: 'ERR_HTTP2_ERROR', | |
| 28 | - type: Error, | ||
| 30 | + type: NghttpError, | ||
| 29 | 31 | message: 'Stream was already closed or invalid' | |
| 30 | 32 | })); | |
| 31 | 33 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | if (!common.hasCrypto) | |
@@ -9,6 +10,7 @@ const { | |||
| 9 | 10 | Http2Stream, | |
| 10 | 11 | nghttp2ErrorString | |
| 11 | 12 | } = process.binding('http2'); | |
| 13 | + const { NghttpError } = require('internal/http2/util'); | ||
| 12 | 14 | ||
| 13 | 15 | // tests error handling within respond | |
| 14 | 16 | // - every other NGHTTP2 error from binding (should emit stream error) | |
@@ -25,7 +27,8 @@ const genericTests = Object.getOwnPropertyNames(constants) | |||
| 25 | 27 | ngError: constants[key], | |
| 26 | 28 | error: { | |
| 27 | 29 | code: 'ERR_HTTP2_ERROR', | |
| 28 | - type: Error, | ||
| 30 | + type: NghttpError, | ||
| 31 | + name: 'Error [ERR_HTTP2_ERROR]', | ||
| 29 | 32 | message: nghttp2ErrorString(constants[key]) | |
| 30 | 33 | }, | |
| 31 | 34 | type: 'stream' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | ||
@@ -14,6 +15,7 @@ const { | |||
| 14 | 15 | Http2Stream, | |
| 15 | 16 | nghttp2ErrorString | |
| 16 | 17 | } = process.binding('http2'); | |
| 18 | + const { NghttpError } = require('internal/http2/util'); | ||
| 17 | 19 | ||
| 18 | 20 | // tests error handling within processRespondWithFD | |
| 19 | 21 | // (called by respondWithFD & respondWithFile) | |
@@ -32,7 +34,8 @@ const genericTests = Object.getOwnPropertyNames(constants) | |||
| 32 | 34 | ngError: constants[key], | |
| 33 | 35 | error: { | |
| 34 | 36 | code: 'ERR_HTTP2_ERROR', | |
| 35 | - type: Error, | ||
| 37 | + type: NghttpError, | ||
| 38 | + name: 'Error [ERR_HTTP2_ERROR]', | ||
| 36 | 39 | message: nghttp2ErrorString(constants[key]) | |
| 37 | 40 | }, | |
| 38 | 41 | type: 'stream' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | ||
@@ -7,14 +8,15 @@ if (!common.hasCrypto) | |||
| 7 | 8 | ||
| 8 | 9 | const http = require('http'); | |
| 9 | 10 | const http2 = require('http2'); | |
| 11 | + const { NghttpError } = require('internal/http2/util'); | ||
| 10 | 12 | ||
| 11 | 13 | const server = http2.createServer(); | |
| 12 | 14 | server.on('stream', common.mustNotCall()); | |
| 13 | 15 | server.on('session', common.mustCall((session) => { | |
| 14 | 16 | session.on('close', common.mustCall()); | |
| 15 | 17 | session.on('error', common.expectsError({ | |
| 16 | 18 | code: 'ERR_HTTP2_ERROR', | |
| 17 | - type: Error, | ||
| 19 | + type: NghttpError, | ||
| 18 | 20 | message: 'Received bad client magic byte string' | |
| 19 | 21 | })); | |
| 20 | 22 | })); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 2 | 3 | ||
| 3 | 4 | const common = require('../common'); | |
| 4 | 5 | if (!common.hasCrypto) | |
@@ -9,6 +10,7 @@ const { | |||
| 9 | 10 | Http2Stream, | |
| 10 | 11 | nghttp2ErrorString | |
| 11 | 12 | } = process.binding('http2'); | |
| 13 | + const { NghttpError } = require('internal/http2/util'); | ||
| 12 | 14 | ||
| 13 | 15 | // tests error handling within pushStream | |
| 14 | 16 | // - NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE (should emit session error) | |
@@ -49,7 +51,8 @@ const genericTests = Object.getOwnPropertyNames(constants) | |||
| 49 | 51 | ngError: constants[key], | |
| 50 | 52 | error: { | |
| 51 | 53 | code: 'ERR_HTTP2_ERROR', | |
| 52 | - type: Error, | ||
| 54 | + type: NghttpError, | ||
| 55 | + name: 'Error [ERR_HTTP2_ERROR]', | ||
| 53 | 56 | message: nghttp2ErrorString(constants[key]) | |
| 54 | 57 | }, | |
| 55 | 58 | type: 'stream' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | + // Flags: --expose-internals | ||
| 3 | + | ||
| 2 | 4 | const common = require('../common'); | |
| 3 | 5 | const assert = require('assert'); | |
| 4 | 6 | const fs = require('fs'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments