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

Post should get updated with additional information (Error handling in classes) #7

Open
Szeraax opened this issue Sep 30, 2020 · 0 comments

Comments

@Szeraax
Copy link

Szeraax commented Sep 30, 2020

https://vexx32.github.io/2019/01/31/PowerShell-Error-Handling/

This post is amazing, but it doesn't talk about error handling in classes (where you don't have $PSCmdlet).

Explain that since PSCmdlet doesn't exist, you should use throw, possibly with an example similar to this:

throw [ArgumentException]::new("Bad data: $argumentVariable")
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

No branches or pull requests

1 participant