Skip to content

Conversation

gerhardol
Copy link
Member

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.

{
AddSettingControl(setting.CreateControlBinding());
throw new Exception($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw new Exception($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex);
throw new ExternalOperationException($"Cannot load settings for plugin {_gitPlugin?.Name ?? "unknown"}", ex);

Copy link
Member Author

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.

Copy link
Member

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.

Suggested change
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);

Copy link
Member Author

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)

Copy link
Member

@RussKie RussKie left a 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)

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.

4 participants