mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Log early exceptions to console (#893)
This commit is contained in:
@@ -48,9 +48,17 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
|
|
||||||
serviceHost.WaitForExit();
|
serviceHost.WaitForExit();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {e}");
|
try
|
||||||
|
{
|
||||||
|
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {ex}");
|
||||||
|
}
|
||||||
|
catch (Exception loggerEx)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Error: Logger unavailable: {loggerEx}");
|
||||||
|
Console.WriteLine($"An unhandled exception occurred: {ex}");
|
||||||
|
}
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
Reference in New Issue
Block a user