Commit a8837939 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Don't fail assert when we send an error to the plugin. (#10207)

parent f5f08959
......@@ -417,7 +417,7 @@ class AppDomain extends Domain {
);
_sendAppEvent(app, 'stop');
} catch (error) {
_sendAppEvent(app, 'stop', <String, dynamic>{'error': error.toString()});
_sendAppEvent(app, 'stop', <String, dynamic>{'error': _toJsonable(error)});
} finally {
fs.currentDirectory = cwd;
_apps.remove(app);
......@@ -699,7 +699,8 @@ dynamic _toJsonable(dynamic obj) {
return obj;
if (obj is OperationResult)
return obj;
assert(false, 'obj not jsonable');
if (obj is ToolExit)
return obj.message;
return '$obj';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment