Browse Source

Add a few fflush(stderr) calls to track down missing stacktraces.

v0.7.4-release
Ryan 15 years ago
parent
commit
d7e220cee1
  1. 3
      src/node.cc

3
src/node.cc

@ -153,6 +153,7 @@ ReportException (TryCatch &try_catch)
Handle<Message> message = try_catch.Message(); Handle<Message> message = try_catch.Message();
if (message.IsEmpty()) { if (message.IsEmpty()) {
fprintf(stderr, "Error: (no message)\n"); fprintf(stderr, "Error: (no message)\n");
fflush(stderr);
return; return;
} }
Handle<Value> error = try_catch.Exception(); Handle<Value> error = try_catch.Exception();
@ -192,6 +193,7 @@ ReportException (TryCatch &try_catch)
String::Utf8Value trace(stack); String::Utf8Value trace(stack);
fprintf(stderr, "%s\n", *trace); fprintf(stderr, "%s\n", *trace);
} }
fflush(stderr);
} }
// Executes a string within the current v8 context. // Executes a string within the current v8 context.
@ -238,6 +240,7 @@ node_exit (const v8::Arguments& args)
int r = 0; int r = 0;
if (args.Length() > 0) if (args.Length() > 0)
r = args[0]->IntegerValue(); r = args[0]->IntegerValue();
fflush(stderr);
exit(r); exit(r);
return Undefined(); return Undefined();
} }

Loading…
Cancel
Save