diff --git a/node.cc b/node.cc index 78b36ee649..b76a462906 100644 --- a/node.cc +++ b/node.cc @@ -16,24 +16,6 @@ using namespace std; static int exit_code = 0; -void -node_fatal_exception (TryCatch &try_catch) -{ - HandleScope handle_scope; - - Local message = try_catch.Message(); - String::Utf8Value error(try_catch.Exception()); - - fprintf( stderr - , "Uncaught Exception. line %d '%s'\n\n" - , try_catch.Message()->GetLineNumber() - , *error - ); - - ev_unloop(node_loop(), EVUNLOOP_ALL); - exit_code = 1; -} - // Reads a file into a v8 string. static Handle ReadFile (const string& name) @@ -129,6 +111,14 @@ void ReportException(v8::TryCatch* try_catch) { } } +void +node_fatal_exception (TryCatch &try_catch) +{ + ReportException(&try_catch); + ev_unloop(node_loop(), EVUNLOOP_ALL); + exit_code = 1; +} + // Executes a string within the current v8 context. bool ExecuteString(v8::Handle source,