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
24 changes: 19 additions & 5 deletions src/mono/browser/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,16 +911,18 @@ protected async Task<bool> EvaluateCondition(SessionId sessionId, ExecutionConte
return true;
}
}
catch (ReturnAsErrorException raee)
catch (ReturnAsErrorException ree)
{
logger.LogDebug($"Unable to evaluate breakpoint condition '{condition}': {raee}");
SendLog(sessionId, $"Unable to evaluate breakpoint condition '{condition}': {raee.Message}", token, type: "error");
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);
}
catch (Exception e)
{
Log("info", $"Unable to evaluate breakpoint condition '{condition}': {e}");
bp.ConditionAlreadyEvaluatedWithError = true;
SendExceptionToTelemetry(e, "EvaluateCondition", sessionId, token);
}
return false;
}
Expand Down Expand Up @@ -1519,17 +1521,29 @@ 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);
}
catch (Exception e)
{
logger.LogDebug($"Error in EvaluateOnCallFrame for expression '{expression}' with '{e}.");
var exc = new ReturnAsErrorException(e.Message, e.GetType().Name);
SendResponse(msg_id, AddCallStackInfoToException(exc.Error, context, scopeId), token);
var ree = new ReturnAsErrorException(e.Message, e.GetType().Name);
SendResponse(msg_id, AddCallStackInfoToException(ree.Error, context, scopeId), token);
SendExceptionToTelemetry(e, "OnEvaluateOnCallFrame", msg_id, token);
}

return true;
}

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

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