diff options
| author | Victor Tran <[email protected]> | 2017-01-11 14:22:12 +1100 |
|---|---|---|
| committer | Victor Tran <[email protected]> | 2017-01-11 14:22:12 +1100 |
| commit | 627c4561722cf829a21c95554f79260f955e5139 (patch) | |
| tree | 6e52d32ae69cf2d3613c6f09c5be9c35358e1fd5 /ShiftOS_TheReturn/TerminalBackend.cs | |
| parent | 5958b0acff0227648e89abe89b91e8b4c48d253e (diff) | |
| download | shiftos_thereturn-627c4561722cf829a21c95554f79260f955e5139.tar.gz shiftos_thereturn-627c4561722cf829a21c95554f79260f955e5139.tar.bz2 shiftos_thereturn-627c4561722cf829a21c95554f79260f955e5139.zip | |
Catch exception when a command throws an unhandled exception
Diffstat (limited to 'ShiftOS_TheReturn/TerminalBackend.cs')
| -rw-r--r-- | ShiftOS_TheReturn/TerminalBackend.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/TerminalBackend.cs b/ShiftOS_TheReturn/TerminalBackend.cs index 70cb25d..bba5510 100644 --- a/ShiftOS_TheReturn/TerminalBackend.cs +++ b/ShiftOS_TheReturn/TerminalBackend.cs @@ -210,6 +210,13 @@ namespace ShiftOS.Engine { return (bool)method.Invoke(null, new[] { args }); } + catch (TargetInvocationException e) + { + Console.WriteLine(Localization.Parse("{ERROR_EXCEPTION_THROWN_IN_METHOD}")); + Console.WriteLine(e.InnerException.Message); + Console.WriteLine(e.InnerException.StackTrace); + return true; + } catch { return (bool)method.Invoke(null, new object[] { }); |
