18void DefaultLogUnhandledException(Dart_Handle, Dart_Handle) {}
19std::atomic<DartError::UnhandledExceptionReporter> log_unhandled_exception =
20 DefaultLogUnhandledException;
22void ReportUnhandledException(Dart_Handle exception_handle,
23 Dart_Handle stack_trace_handle) {
24 log_unhandled_exception.load()(exception_handle, stack_trace_handle);
30 log_unhandled_exception.store(reporter);
36 if (Dart_IsUnhandledExceptionError(handle)) {
37 Dart_Handle exception_handle = Dart_ErrorGetException(handle);
38 Dart_Handle stack_trace_handle = Dart_ErrorGetStackTrace(handle);
40 ReportUnhandledException(exception_handle, stack_trace_handle);
42 }
else if (Dart_IsFatalError(handle)) {
48 }
else if (Dart_IsError(handle)) {
49 tonic::Log(
"Dart Error: %s", Dart_GetError(handle));
57 if (Dart_IsCompilationError(handle)) {
59 }
else if (Dart_IsApiError(handle)) {
61 }
else if (Dart_IsError(handle)) {
69 if (Dart_IsCompilationError(handle)) {
71 }
else if (Dart_IsApiError(handle)) {
73 }
else if (Dart_IsError(handle)) {
const char kInvalidArgument[]
void(*)(Dart_Handle, Dart_Handle) UnhandledExceptionReporter
DartErrorHandleType GetErrorHandleType(Dart_Handle handle)
void SetUnhandledExceptionReporter(DartError::UnhandledExceptionReporter reporter)
int GetErrorExitCode(Dart_Handle handle)
bool CheckAndHandleError(Dart_Handle handle)
void Log(const char *format,...)