Skip to content

Show error message when a fatal error occurs - #805

Merged
ErikMogensen merged 2 commits into
mainfrom
ShowFatalError
Nov 4, 2024
Merged

ErikMogensen merged 2 commits into
mainfrom
ShowFatalError

Conversation

@ErikMogensen

Copy link
Copy Markdown
Collaborator

This happens if the user configuration contains invalid XML, for instance.

@SeanFeldman SeanFeldman left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple of comments.
Didn't know SBE fails upon startup. Would it be because of invalid settings? If that the case, perhaps we should be more explicit.

Comment thread src/ServiceBusExplorer/Program.cs Outdated
Co-authored-by: Sean Feldman 
@ErikMogensen

Copy link
Copy Markdown
Collaborator Author

Didn't know SBE fails upon startup. Would it be because of invalid settings? If that the case, perhaps we should be more explicit.

If I add a dash to the configuration tag in the user config file, SBE just silently dies. This PR makes it say:
image

Originally I showed the stack trace but it was huge and would scare many users.

@ErikMogensen

Copy link
Copy Markdown
Collaborator Author

The stack could automatically be copied to the clipboard, but that would be unexpected and sometimes not desired. Adding a button for optionally copying the stack, would as far as I know require a custom dialog box, which is more than I had in mind for this PR. But anyone is free to add that functionality in the future... 😃

@SeanFeldman

Copy link
Copy Markdown
Collaborator

The stack could automatically be copied to the clipboard, but that would be unexpected and sometimes not desired.

Why would it be undesired? Also, if you say in the error that the stacktrace has been copied to the clipboard, it's no longer unexpected 🙂

Personally, I really dislike taking screenshots of errors because there's no other way to re-read that error message. And sure thing I will not remember which line and column there was an issue with.

@ErikMogensen
ErikMogensen merged commit 63779e0 into main Nov 4, 2024
@ErikMogensen
ErikMogensen deleted the ShowFatalError branch November 4, 2024 18:36
@ErikMogensen

Copy link
Copy Markdown
Collaborator Author

Why would it be undesired? Also, if you say in the error that the stacktrace has been copied to the clipboard, it's no longer unexpected 🙂

What if I have a Entra client secret in the clipboard, start SBE and then I would lose the secret and have a stack trace there instead.

Personally, I really dislike taking screenshots of errors because there's no other way to re-read that error message. And sure thing I will not remember which line and column there was an issue with.

I agree. I would like to see it writing the stack to a log file. In the error message it should show the path to the file.

@SeanFeldman

Copy link
Copy Markdown
Collaborator

What if I have a Entra client secret in the clipboard, start SBE and then I would lose the secret and have a stack trace there instead.

Clipboard on Windows 10 and 11 can retain more than one entry.

@ErikMogensen

Copy link
Copy Markdown
Collaborator Author

Clipboard on Windows 10 and 11 can retain more than one entry.

Yes, but I believe there is a lot of people who don't use it. Also, I have never used an application that replaced the contents of the clipboard on its own accord.

@SeanFeldman

Copy link
Copy Markdown
Collaborator

Then, you'll be forced to memorize the line and the position. Fun.

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