* @param {number} uid
(uid)
| 63 | * @param {number} uid |
| 64 | */ |
| 65 | constructor(uid) { |
| 66 | const message = 'Unhandled promise rejection. This error originated either by ' + |
| 67 | 'throwing inside of an async function without a catch block, ' + |
| 68 | 'or by rejecting a promise which was not handled with .catch(). ' + |
| 69 | 'To terminate the node process on unhandled promise ' + |
| 70 | 'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' + |
| 71 | 'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ' + |
| 72 | `(rejection id: ${uid})`; |
| 73 | |
| 74 | // UnhandledPromiseRejectionWarning will get the stack trace from the |
| 75 | // reason, so we can disable the stack trace limit temporarily for better |
| 76 | // performance. |
| 77 | if (isErrorStackTraceLimitWritable()) { |
| 78 | const stackTraceLimit = Error.stackTraceLimit; |
| 79 | Error.stackTraceLimit = 0; |
| 80 | super(message); |
| 81 | Error.stackTraceLimit = stackTraceLimit; |
| 82 | } else { |
| 83 | super(message); |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | class PromiseRejectionHandledWarning extends Error { |
nothing calls this directly
no test coverage detected