diff --git a/doc/api/repl.md b/doc/api/repl.md index c384ebf1391..7a57af57442 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -232,6 +232,15 @@ undefined undefined ``` +### Error handling + +By default, uncaught exceptions in the REPL are printed to the output stream +(as with `Uncaught Error: REPL await` above). `uncaughtException` listeners +can be added freely in both standalone and nested REPLs. The `handleError` +option of [`repl.start()`][] can customize this behavior, including +forwarding exceptions to [`'uncaughtException'`][] by returning +`'unhandled'`. + ### Reverse-i-search