Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-06-02 16:47:53 +0300
committerAnna Henningsen <anna@addaleax.net>2019-06-09 23:34:42 +0300
commit626f24374741c4ee83c7da45542b99e67855707d (patch)
tree4b940f03d3dcc00de289c647c62bdecceca9cc36 /src/node_errors.cc
parent890223dede339622e7e66e8629805f7904840870 (diff)
src: handle exceptions from ToDetailString()
These methods may fail if execution is terminating. PR-URL: https://github.com/nodejs/node/pull/28019 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r--src/node_errors.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 603c9e415c3..baf08b30458 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -180,7 +180,8 @@ void PrintException(Isolate* isolate,
Local<Value> err,
Local<Message> message) {
node::Utf8Value reason(isolate,
- err->ToDetailString(context).ToLocalChecked());
+ err->ToDetailString(context)
+ .FromMaybe(Local<String>()));
bool added_exception_line = false;
std::string source =
GetErrorSource(isolate, context, message, &added_exception_line);