Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed uncaught exception when XRefMap is invalid #1785

Merged
merged 1 commit into from
May 10, 2024

Conversation

PathogenDavid
Copy link
Member

The deserialization exceptions were making it to the generic unhandled exception dialog due to the relevant catch clause looking for SystemException.

SystemException (and its complement ApplicationException) is a bit of a failed experiment from .NET Framework 1. It's no longer used for new System.* exceptions, and even before .NET Core it was applied very inconsistently. IMO the line between exceptions in the System namespace and exceptions outside of it is basically meaningless and very fuzzy regardless.

As such this PR increases the scope to just plain Exception.


This still would have resulted in very vague low-level errors reaching the end user, so I introduced DocumentationException to denote specific errors when parsing the XRefMap.

When one XRefMap fails due to a 404 and another fails due to a DocumentationException, the DocumentationException takes priority.


Here is the error that occurs when the documentation server responds with something other than an XRefMap:

image

And here's the error that occurs when the documentation server responds with something that claims to be an XRefMap but isn't unusable:

image

Fixes #1507

Copy link
Member

@glopesdev glopesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks! Just very minor style tweaks for consistency with current code, looking forward to drafting together a style guide for modern .NET.

Bonsai.Editor/DocumentationHelper.cs Outdated Show resolved Hide resolved
Bonsai.Editor/DocumentationHelper.cs Outdated Show resolved Hide resolved
Bonsai.Editor/DocumentationHelper.cs Show resolved Hide resolved
@glopesdev glopesdev added the fix Pull request that fixes an issue label May 9, 2024
@glopesdev glopesdev added this to the 2.8.3 milestone May 9, 2024
@PathogenDavid
Copy link
Member Author

Fixed!

looking forward to drafting together a style guide for modern .NET.

I'll definitely have strong opinions about your try { SingleLine(); } habit. It breaks auto-formatting 😅

I can cope for now though.

@PathogenDavid PathogenDavid requested a review from glopesdev May 10, 2024 00:02
@glopesdev glopesdev changed the title Fixed uncaught exception when XRefMap is invalid. Fixed uncaught exception when XRefMap is invalid May 10, 2024
@glopesdev glopesdev merged commit d55338f into bonsai-rx:main May 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull request that fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception thrown when cross-reference file link returns invalid format
2 participants