lib: refactor ERR_SYNTHETIC
- Tidy up description in docs. - Remove a second definition in the docs. - Remove unused string input parameter. - Remove duplicate "JavaScript Callstack" in error messages. PR-URL: https://github.com/nodejs/node/pull/25749 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
80a18cac8b
commit
5aa89d616f
@ -1692,8 +1692,8 @@ length.
|
|||||||
<a id="ERR_SYNTHETIC"></a>
|
<a id="ERR_SYNTHETIC"></a>
|
||||||
#### ERR_SYNTHETIC
|
#### ERR_SYNTHETIC
|
||||||
|
|
||||||
An artificial error object used to capture call stack when diagnostic report
|
An artificial error object used to capture the call stack for diagnostic
|
||||||
is produced.
|
reports.
|
||||||
|
|
||||||
<a id="ERR_SYSTEM_ERROR"></a>
|
<a id="ERR_SYSTEM_ERROR"></a>
|
||||||
### ERR_SYSTEM_ERROR
|
### ERR_SYSTEM_ERROR
|
||||||
@ -2233,12 +2233,6 @@ size.
|
|||||||
This `Error` is thrown when a read is attempted on a TTY `WriteStream`,
|
This `Error` is thrown when a read is attempted on a TTY `WriteStream`,
|
||||||
such as `process.stdout.on('data')`.
|
such as `process.stdout.on('data')`.
|
||||||
|
|
||||||
<a id="ERR_SYNTHETIC"></a>
|
|
||||||
#### ERR_SYNTHETIC
|
|
||||||
|
|
||||||
An artifical error object used to capture call stack when diagnostic report
|
|
||||||
is produced.
|
|
||||||
|
|
||||||
|
|
||||||
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
|
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
|
||||||
[`--force-fips`]: cli.html#cli_force_fips
|
[`--force-fips`]: cli.html#cli_force_fips
|
||||||
|
@ -923,7 +923,7 @@ E('ERR_STREAM_UNSHIFT_AFTER_END_EVENT',
|
|||||||
'stream.unshift() after end event', Error);
|
'stream.unshift() after end event', Error);
|
||||||
E('ERR_STREAM_WRAP', 'Stream has StringDecoder set or is in objectMode', Error);
|
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_STREAM_WRITE_AFTER_END', 'write after end', Error);
|
||||||
E('ERR_SYNTHETIC', 'JavaScript Callstack: %s', Error);
|
E('ERR_SYNTHETIC', 'JavaScript Callstack', Error);
|
||||||
E('ERR_SYSTEM_ERROR', 'A system error occurred', SystemError);
|
E('ERR_SYSTEM_ERROR', 'A system error occurred', SystemError);
|
||||||
E('ERR_TLS_CERT_ALTNAME_INVALID',
|
E('ERR_TLS_CERT_ALTNAME_INVALID',
|
||||||
'Hostname/IP does not match certificate\'s altnames: %s', Error);
|
'Hostname/IP does not match certificate\'s altnames: %s', Error);
|
||||||
|
@ -101,13 +101,11 @@ exports.setup = function() {
|
|||||||
emitExperimentalWarning('report');
|
emitExperimentalWarning('report');
|
||||||
if (err == null) {
|
if (err == null) {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
return nr.triggerReport(new ERR_SYNTHETIC(
|
return nr.triggerReport(new ERR_SYNTHETIC().stack);
|
||||||
'JavaScript Callstack').stack);
|
|
||||||
}
|
}
|
||||||
if (typeof file !== 'string')
|
if (typeof file !== 'string')
|
||||||
throw new ERR_INVALID_ARG_TYPE('file', 'String', file);
|
throw new ERR_INVALID_ARG_TYPE('file', 'String', file);
|
||||||
return nr.triggerReport(file, new ERR_SYNTHETIC(
|
return nr.triggerReport(file, new ERR_SYNTHETIC().stack);
|
||||||
'JavaScript Callstack').stack);
|
|
||||||
}
|
}
|
||||||
if (typeof err !== 'object')
|
if (typeof err !== 'object')
|
||||||
throw new ERR_INVALID_ARG_TYPE('err', 'Object', err);
|
throw new ERR_INVALID_ARG_TYPE('err', 'Object', err);
|
||||||
@ -120,7 +118,7 @@ exports.setup = function() {
|
|||||||
getReport(err) {
|
getReport(err) {
|
||||||
emitExperimentalWarning('report');
|
emitExperimentalWarning('report');
|
||||||
if (err == null) {
|
if (err == null) {
|
||||||
return nr.getReport(new ERR_SYNTHETIC('JavaScript Callstack').stack);
|
return nr.getReport(new ERR_SYNTHETIC().stack);
|
||||||
} else if (typeof err !== 'object') {
|
} else if (typeof err !== 'object') {
|
||||||
throw new ERR_INVALID_ARG_TYPE('err', 'Objct', err);
|
throw new ERR_INVALID_ARG_TYPE('err', 'Objct', err);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user