Skip to content

Conversation

@MartinKuschnik
Copy link
Owner

…lid parameters are provided to WMI methods.

…cuteMethod overloads in WmiConnection.cs to clarify that these methods may throw this exception when WMI method parameters are invalid.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a new custom exception type InvalidMethodParametersException to provide better error handling when invalid parameters are passed to WMI methods. The change improves error diagnostics by catching the specific WBEM_E_INVALID_METHOD_PARAMETERS HRESULT and wrapping it in a more descriptive exception.

Key changes:

  • Created a new InvalidMethodParametersException class that extends WmiException
  • Updated WbemServices.ExecuteMethod to catch and throw this specific exception
  • Added XML documentation for the new exception across all ExecuteMethod overloads in WmiConnection

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.

File Description
WmiLight/Exceptions/InvalidMethodParametersException.cs New exception class for handling invalid WMI method parameters with descriptive error message
WmiLight/Wbem/WbemServices.cs Updated exception handling to detect and throw InvalidMethodParametersException when parameters are invalid
WmiLight/WmiConnection.cs Added XML documentation for the new exception across all 8 ExecuteMethod method overloads

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…names,

and its message includes both for improved context.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MartinKuschnik MartinKuschnik merged commit 33fc261 into master Jan 1, 2026
2 checks passed
@MartinKuschnik MartinKuschnik deleted the better-exceptions-for-ExecuteMethod branch January 1, 2026 18:10
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.

1 participant