inspector: display error when ToggleAsyncHook fails
This patch refactors AppendExceptionLine
and PrintSyncTrace
to reuse the error formatting logic and use them to print
uncaught error in ``ToggleAsyncHook`
Refs: https://github.com/nodejs/node/issues/26798
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines