mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-26 01:25:42 -05:00
Improving profiler error messages (#658)
* Improving error messages * Fixing stopping error message * Cleaning up repeat error messages * Changing error names
This commit is contained in:
committed by
GitHub
parent
b8c31e1138
commit
ec9d51ede1
@@ -146,7 +146,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await requestContext.SendError(e);
|
||||
await requestContext.SendError(new Exception(SR.StartSessionFailed(e.Message)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,13 +159,18 @@ namespace Microsoft.SqlTools.ServiceLayer.Profiler
|
||||
{
|
||||
ProfilerSession session;
|
||||
monitor.StopMonitoringSession(parameters.OwnerUri, out session);
|
||||
session.XEventSession.Stop();
|
||||
|
||||
if (session == null)
|
||||
{
|
||||
throw new Exception(SR.SessionNotFound);
|
||||
}
|
||||
|
||||
session.XEventSession.Stop();
|
||||
await requestContext.SendResult(new StopProfilingResult{});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await requestContext.SendError(e);
|
||||
await requestContext.SendError(new Exception(SR.StopSessionFailed(e.Message)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user