diff --git a/doc/api/repl.md b/doc/api/repl.md index 3c61adb450f..c7c6a80af76 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -276,6 +276,15 @@ Uncaught SyntaxError: Identifier 'm' has already been declared [`--no-experimental-repl-await`][] shall disable top-level await in REPL. +### 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