We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 496c359 commit 5e7a00eCopy full SHA for 5e7a00e
1 file changed
src/nbgv/Program.cs
@@ -215,9 +215,23 @@ private static Parser BuildCommandLine()
215
}
216
217
}, (MiddlewareOrder)(-3000)) // MiddlewareOrderInternal.ExceptionHandler so [parse] directive is accurate.
218
+ .UseExceptionHandler((ex, context) => PrintException(ex, context))
219
.Build();
220
221
222
+ private static void PrintException(Exception ex, InvocationContext context)
223
+ {
224
+ try
225
226
+ Console.Error.WriteLine("Unhandled exception: {0}", ex);
227
+ }
228
+ catch (Exception ex2)
229
230
+ Console.Error.WriteLine("Unhandled exception: {0}", ex.Message);
231
+ Console.Error.WriteLine("Unhandled exception while trying to print string version of the above exception: {0}", ex2);
232
233
234
+
235
private static int MainInner(string[] args)
236
{
237
try
0 commit comments