Skip to content

Conversation

Copy link

Copilot AI commented Nov 1, 2025

The geocoding click handlers caught generic exceptions but only displayed ex.Message, losing stack traces and exception types needed for debugging.

Changes

  • Exception display: Changed from {ex.Message} to {ex} in markdown code blocks to show full exception details (type, message, stack trace)
  • Applied to: RiskMapLayoutArea.cs and PropertyRisksLayoutArea.cs
  • Type inference fix: Changed .Select() to .SelectMany() in RiskMapLayoutArea.cs where lambda returns were mixing UiControl and IObservable<UiControl>
// Before
catch (Exception ex)
{
    obj.Host.UpdateArea(obj.Area, Controls.Markdown($"**Geocoding Failed**: {ex.Message}"));
}

// After
catch (Exception ex)
{
    obj.Host.UpdateArea(obj.Area, Controls.Markdown($"**Geocoding Failed**:\n```\n{ex}\n```"));
}

Follows the pattern established in DomainViews.cs for error display.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Changed generic catch block to display full exception details instead of just the message
- Wrapped exception in markdown code block for better readability
- Fixed type inference issue in RiskMapLayoutArea by changing Select to SelectMany
- Applied same fix to both RiskMapLayoutArea.cs and PropertyRisksLayoutArea.cs

Co-authored-by: rbuergi <6334612+rbuergi@users.noreply.github.com>
@rbuergi rbuergi closed this Nov 1, 2025
Copilot AI changed the title [WIP] Update to address feedback and changes from PR #59 Improve exception reporting in geocoding error handlers Nov 1, 2025
Copilot AI requested a review from rbuergi November 1, 2025 00:29
@rbuergi rbuergi deleted the copilot/sub-pr-59-yet-again branch November 3, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants