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:
Madeline MacDonald
2018-07-16 18:22:12 -07:00
committed by GitHub
parent b8c31e1138
commit ec9d51ede1
5 changed files with 69 additions and 3 deletions

View File

@@ -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)));
}
}