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

Improve specificity of error messages #4

Open
rdbahm opened this issue Jul 20, 2017 · 4 comments
Open

Improve specificity of error messages #4

rdbahm opened this issue Jul 20, 2017 · 4 comments

Comments

@rdbahm
Copy link
Owner

rdbahm commented Jul 20, 2017

When receiving an error from almost any cmdlet, it will be generic and does not specify specifically what kind of error occurred, especially if that error occurred in a deeper level function.

@rdbahm
Copy link
Owner Author

rdbahm commented Jan 5, 2018

Maybe we should be using syntax like:

$Exception = New-Object System.WhateverException "Error message goes here"
Throw $Exception

Specifically, this will help by changing the error type from a "Write-Error exception" to the proper type.

@rdbahm
Copy link
Owner Author

rdbahm commented Jan 5, 2018

Looks like we should also probably use "InnerException" to collect up the root cause. For example:

$InnerException = New-Object System.SomethingException "This is the first exception."
$OuterException = New-Object System.OtherException ("This is the outer exception",$InnerException)

@rdbahm
Copy link
Owner Author

rdbahm commented Jan 5, 2018

Did some work on this in:
0fae76b
70c73e8
208d9c2
d0c204e
d331403

Not complete by any means, but considering set-ucsrestparameter a test implementation of one way to do this.

@rdbahm
Copy link
Owner Author

rdbahm commented Jun 22, 2018

I'm still not pleased with this but I haven't spent enough time figuring out a good way to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant