Remove the 'Error: (no message)' exceptions print stack trace instead

v0.7.4-release
Ryan Dahl 2010-03-09 11:20:58 -08:00
parent f8eb163728
commit dd21a4f4b9
1 changed files with 1 additions and 6 deletions

View File

@ -335,11 +335,6 @@ const char* ToCString(const v8::String::Utf8Value& value) {
static void ReportException(TryCatch &try_catch, bool show_line = false) {
Handle<Message> message = try_catch.Message();
if (message.IsEmpty()) {
fprintf(stderr, "Error: (no message)\n");
fflush(stderr);
return;
}
Handle<Value> error = try_catch.Exception();
Handle<String> stack;
@ -350,7 +345,7 @@ static void ReportException(TryCatch &try_catch, bool show_line = false) {
if (raw_stack->IsString()) stack = Handle<String>::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);