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 { ...@@ -417,7 +417,7 @@ class AppDomain extends Domain {
); );
_sendAppEvent(app, 'stop'); _sendAppEvent(app, 'stop');
} catch (error) { } catch (error) {
_sendAppEvent(app, 'stop', <String, dynamic>{'error': error.toString()}); _sendAppEvent(app, 'stop', <String, dynamic>{'error': _toJsonable(error)});
} finally { } finally {
fs.currentDirectory = cwd; fs.currentDirectory = cwd;
_apps.remove(app); _apps.remove(app);
...@@ -699,7 +699,8 @@ dynamic _toJsonable(dynamic obj) { ...@@ -699,7 +699,8 @@ dynamic _toJsonable(dynamic obj) {
return obj; return obj;
if (obj is OperationResult) if (obj is OperationResult)
return obj; return obj;
assert(false, 'obj not jsonable'); if (obj is ToolExit)
return obj.message;
return '$obj'; 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