-
Notifications
You must be signed in to change notification settings - Fork 117
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
Other types of auth errors #128
Labels
Comments
Odd. I was thinking the same thing this morning about 👍 Seems like a good proposal. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WinRMAuthorizationError
is a subclass ofWinRMError
and so it doesn't store any info about the HTTP response. I think it should be a subclass ofWinRMHTTPTransportError
so that the response code, and possibly other response details, are saved in the exception?Why? There could arguably be more than one response code that should raise a
WinRMAuthorizationError
. A case could be made that[403 Forbidden](https://www.danielirvine.com/blog/2011/07/18/understanding-403-forbidden/)
should also raise the error, though they might be different enough to warrant different exception types (a 401, for example, might mean that the session expired but that re-authenticating and retrying the request with the same credentials may work; a 403 means re-authenticating with the same credentials won't help and that you either need to switch users or elevate the existing users permissions).Even if the exception is only raised for 401, there are multiple "subcodes" of 401 that Microsoft uses. These are sent in the HTTP response Reason-Phrase, which is "intended to give a short textual description of the Status-Code. The Status-Code is intended for use by automata and the Reason-Phrase is intended for the human user."
Summary/recommendations:
The text was updated successfully, but these errors were encountered: