From dd21a4f4b9f76e31b7a7990be3937a836eb27c60 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 9 Mar 2010 11:20:58 -0800 Subject: [PATCH] Remove the 'Error: (no message)' exceptions print stack trace instead --- src/node.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/node.cc b/src/node.cc index 0911912fa6..b7fad3055e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -335,11 +335,6 @@ const char* ToCString(const v8::String::Utf8Value& value) { static void ReportException(TryCatch &try_catch, bool show_line = false) { Handle message = try_catch.Message(); - if (message.IsEmpty()) { - fprintf(stderr, "Error: (no message)\n"); - fflush(stderr); - return; - } Handle error = try_catch.Exception(); Handle stack; @@ -350,7 +345,7 @@ static void ReportException(TryCatch &try_catch, bool show_line = false) { if (raw_stack->IsString()) stack = Handle::Cast(raw_stack); } - if (show_line) { + if (show_line && !message.IsEmpty()) { // Print (filename):(line number): (message). String::Utf8Value filename(message->GetScriptResourceName()); const char* filename_string = ToCString(filename);