Log the sticky error during isolate shutdown (flutter/engine#8742)

The sticky error may be set in cases such as an unhandled asynchronous
exception.  This is similar to the logging done in the Dart command line
embedder's isolate shutdown callback.
This commit is contained in:
Jason Simmons
2019-04-25 15:08:53 -07:00
committed by GitHub
parent 9f70d84295
commit 244d864381

View File

@@ -791,6 +791,14 @@ void DartIsolate::AddIsolateShutdownCallback(fml::closure closure) {
}
void DartIsolate::OnShutdownCallback() {
{
tonic::DartApiScope api_scope;
Dart_Handle sticky_error = Dart_GetStickyError();
if (!Dart_IsNull(sticky_error) && !Dart_IsFatalError(sticky_error)) {
FML_LOG(ERROR) << Dart_GetError(sticky_error);
}
}
shutdown_callbacks_.clear();
if (isolate_shutdown_callback_) {
isolate_shutdown_callback_();