* @param {PromiseInfo} promiseInfo
(promiseInfo)
| 223 | * @param {PromiseInfo} promiseInfo |
| 224 | */ |
| 225 | function emitUnhandledRejectionWarning(promiseInfo) { |
| 226 | const warning = new UnhandledPromiseRejectionWarning(promiseInfo.uid); |
| 227 | const reason = promiseInfo.reason; |
| 228 | try { |
| 229 | if (isErrorLike(reason)) { |
| 230 | warning.stack = reason.stack; |
| 231 | process.emitWarning(reason.stack, unhandledRejectionErrName); |
| 232 | } else { |
| 233 | process.emitWarning( |
| 234 | noSideEffectsToString(reason), unhandledRejectionErrName); |
| 235 | } |
| 236 | } catch { |
| 237 | try { |
| 238 | process.emitWarning( |
| 239 | noSideEffectsToString(reason), unhandledRejectionErrName); |
| 240 | } catch { |
| 241 | // Ignore. |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | process.emitWarning(warning); |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * @callback UnhandledRejectionsModeHandler |
no test coverage detected
searching dependent graphs…