repl: do not swallow errors in nested REPLs
For tab completion, a REPLServer instance will sometimes create another
REPLServer instance. If a callback is sent to the .complete()
function
and that callback throws an error, it will be swallowed by the nested
REPLs domain. Re-throw the error so that processes don't silently exit
without any indication of an error (including a status code).
Fixes: https://github.com/nodejs/node/issues/21586
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines