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

Show error message when a fatal error occurs #805

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Conversation

ErikMogensen
Copy link
Collaborator

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

Copy link
Collaborator

@SeanFeldman SeanFeldman left a comment

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.

src/ServiceBusExplorer/Program.cs Outdated Show resolved Hide resolved
@ErikMogensen
Copy link
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
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
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
2 checks passed
@ErikMogensen ErikMogensen deleted the ShowFatalError branch November 4, 2024 18:36
@ErikMogensen
Copy link
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
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
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
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