diff --git a/doc/api/errors.md b/doc/api/errors.md index 3deab7397c6ec2..24e2290e472b6b 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -2829,25 +2829,6 @@ An unspecified or non-specific system error has occurred within the Node.js process. The error object will have an `err.info` object property with additional details. - - -### `ERR_TAP_LEXER_ERROR` - -An error representing a failing lexer state. - - - -### `ERR_TAP_PARSER_ERROR` - -An error representing a failing parser state. Additional information about -the token causing the error is available via the `cause` property. - - - -### `ERR_TAP_VALIDATION_ERROR` - -This error represents a failed TAP validation. - ### `ERR_TEST_FAILURE` @@ -3883,6 +3864,25 @@ removed: v10.0.0 Used when an attempt is made to use a readable stream that has not implemented [`readable._read()`][]. + + +### `ERR_TAP_LEXER_ERROR` + +An error representing a failing lexer state. + + + +### `ERR_TAP_PARSER_ERROR` + +An error representing a failing parser state. Additional information about +the token causing the error is available via the `cause` property. + + + +### `ERR_TAP_VALIDATION_ERROR` + +This error represents a failed TAP validation. + ### `ERR_TLS_RENEGOTIATION_FAILED` diff --git a/lib/internal/errors.js b/lib/internal/errors.js index d990f8d5a106aa..bda50797124758 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -1739,21 +1739,6 @@ E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode', Error); E('ERR_STREAM_WRITE_AFTER_END', 'write after end', Error); E('ERR_SYNTHETIC', 'JavaScript Callstack', Error); E('ERR_SYSTEM_ERROR', 'A system error occurred', SystemError, HideStackFramesError); -E('ERR_TAP_LEXER_ERROR', function(errorMsg) { - hideInternalStackFrames(this); - return errorMsg; -}, Error); -E('ERR_TAP_PARSER_ERROR', function(errorMsg, details, tokenCausedError, source) { - hideInternalStackFrames(this); - this.cause = tokenCausedError; - const { column, line, start, end } = tokenCausedError.location; - const errorDetails = `${details} at line ${line}, column ${column} (start ${start}, end ${end})`; - return errorMsg + errorDetails; -}, SyntaxError); -E('ERR_TAP_VALIDATION_ERROR', function(errorMsg) { - hideInternalStackFrames(this); - return errorMsg; -}, Error); E('ERR_TEST_FAILURE', function(error, failureType) { hideInternalStackFrames(this); assert(typeof failureType === 'string' || typeof failureType === 'symbol',