Skip to content

Replace use of throw GetExceptionForHR with ThrowExceptionForHR - #11640

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
xtqqczze:patch/GetExceptionForHR
Jan 31, 2020
Merged

Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
xtqqczze:patch/GetExceptionForHR

Conversation

@xtqqczze

Copy link
Copy Markdown
Contributor

PR Summary

System.Runtime.InteropServices.Marshall.GetExceptionForHR may not return an exception. Instead of throw GetExceptionForHR we can use ThrowExceptionForHR.

PR Context

Fix warnings CS8597:Thrown value may be null.

PR Checklist

`System.Runtime.InteropServices.Marshall.GetExceptionForHR` may not return an exception. Instead of `throw GetExceptionForHR` we can use `ThrowExceptionForHR`.

Fix warnings `CS8597:Thrown value may be null.`
@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Jan 21, 2020
@iSazonov Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Jan 21, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

Dongbo Wang (@daxian-dbw) please review :)

@iSazonov Ilya (iSazonov) self-assigned this Jan 31, 2020
@iSazonov
Ilya (iSazonov) merged commit c4e144b into PowerShell:master Jan 31, 2020
@xtqqczze
xtqqczze deleted the patch/GetExceptionForHR branch February 1, 2020 12:25
@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…rShell#11640)

`System.Runtime.InteropServices.Marshall.GetExceptionForHR` may not return an exception. Instead of `throw GetExceptionForHR` we can use `ThrowExceptionForHR`.

Fix warnings `CS8597:Thrown value may be null.`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants