Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/mono/browser/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -916,13 +916,13 @@ protected async Task<bool> EvaluateCondition(SessionId sessionId, ExecutionConte
logger.LogDebug($"Unable to evaluate breakpoint condition '{condition}': {ree}");
SendLog(sessionId, $"Unable to evaluate breakpoint condition '{condition}': {ree.Message}", token, type: "error");
bp.ConditionAlreadyEvaluatedWithError = true;
SendExceptionToTelemetry(ree, "EvaluateCondition", sessionId, token);
ReportDebuggerExceptionToTelemetry("EvaluateCondition", sessionId, token);
}
catch (Exception e)
{
Log("info", $"Unable to evaluate breakpoint condition '{condition}': {e}");
bp.ConditionAlreadyEvaluatedWithError = true;
SendExceptionToTelemetry(e, "EvaluateCondition", sessionId, token);
ReportDebuggerExceptionToTelemetry("EvaluateCondition", sessionId, token);
}
return false;
}
Expand Down Expand Up @@ -1521,27 +1521,27 @@ private async Task<bool> OnEvaluateOnCallFrame(MessageId msg_id, int scopeId, st
catch (ReturnAsErrorException ree)
{
SendResponse(msg_id, AddCallStackInfoToException(ree.Error, context, scopeId), token);
SendExceptionToTelemetry(ree, "OnEvaluateOnCallFrame", msg_id, token);
ReportDebuggerExceptionToTelemetry("OnEvaluateOnCallFrame", msg_id, token);
}
catch (Exception e)
{
logger.LogDebug($"Error in EvaluateOnCallFrame for expression '{expression}' with '{e}.");
var ree = new ReturnAsErrorException(e.Message, e.GetType().Name);
SendResponse(msg_id, AddCallStackInfoToException(ree.Error, context, scopeId), token);
SendExceptionToTelemetry(e, "OnEvaluateOnCallFrame", msg_id, token);
ReportDebuggerExceptionToTelemetry("OnEvaluateOnCallFrame", msg_id, token);
}

return true;
}

private void SendExceptionToTelemetry(Exception exc, string callingFunction, SessionId msg_id, CancellationToken token)
private void ReportDebuggerExceptionToTelemetry(string callingFunction, SessionId msg_id, CancellationToken token)
{
JObject reportBlazorDebugError = JObject.FromObject(new
JObject reportBlazorDebugException = JObject.FromObject(new
{
exceptionType = "uncaughtException",
error = $"{exc.Message} at {callingFunction}",
exception = $"BlazorDebugger exception at {callingFunction}",
});
SendEvent(msg_id, "DotnetDebugger.reportBlazorDebugError", reportBlazorDebugError, token);
SendEvent(msg_id, "DotnetDebugger.reportBlazorDebugException", reportBlazorDebugException, token);
}

internal async Task<GetMembersResult> GetScopeProperties(SessionId msg_id, int scopeId, CancellationToken token)
Expand Down
Loading