Example #1
0
void caml_fatal_uncaught_exception(value exn)
{
  caml_root handle_uncaught_exception =
    caml_named_root("Printexc.handle_uncaught_exception");
  if (handle_uncaught_exception)
    /* [Printexc.handle_uncaught_exception] does not raise exception. */
    caml_callback2(caml_read_root(handle_uncaught_exception), exn, Val_bool(DEBUGGER_IN_USE));
  else
    default_fatal_uncaught_exception(exn);
  /* Terminate the process */
  exit(2);
}
Example #2
0
void caml_fatal_uncaught_exception(value exn)
{
  const value* handle_uncaught_exception =
    caml_named_value("Printexc.handle_uncaught_exception");
  if (handle_uncaught_exception)
    /* [Printexc.handle_uncaught_exception] does not raise exception. */
    caml_callback2(*handle_uncaught_exception, exn, Val_bool(DEBUGGER_IN_USE));
  else
    default_fatal_uncaught_exception(exn);
  /* Terminate the process */
  if (caml_abort_on_uncaught_exn) {
    abort();
  } else {
    CAML_SYS_EXIT(2);
    exit(2); /* Second exit needed for the Noreturn flag */
  }
}