-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: catch plugin settings load exceptions #12219
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
fix: catch plugin settings load exceptions #12219
Conversation
{ | ||
AddSettingControl(setting.CreateControlBinding()); | ||
throw new Exception($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔
throw new Exception($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex); | |
throw new ExternalOperationException($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really an external exception, all info is not meaningful:
public ExternalOperationException(
string? command = null,
string? arguments = null,
string? workingDirectory = null,
int? exitCode = null,
Exception? innerException = null)
UserExternalOperationException can be used, but does not make sense either to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key is that the BugReportReportInvoker
presents the ExternalOperationException
without "Report bug" as default but with the hint that something external failed - most likely in user's responsibility.
This might be applicable here: A plugin might be outdated.
The arguments are optional. My suggestion was incomplete.
throw new Exception($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex); | |
throw new ExternalOperationException(command: $"Load settings for plugin {_gitPlugin?.Name ?? "unknown"}", innerException: ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
This problem is likely in the bundled plugins or GE core, but no need to alarm users...
(Also keeping Cannot)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (modulo the suggestion from @mstv)
Some info to debug #12212 etc
The most common NBug after Windows update issues and Git reporting errors.
Proposed changes
The exception does not even contain the plugin that fails right now.
More info can be added?
Test methodology
Added throw to see the message appeared.
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.