DMTF/python-redfish-library

InvalidCredentialsError on service unavailable

Closed this issue · 1 comments

The HttpClient (https://github.com/DMTF/python-redfish-library/blob/master/src/redfish/rest/v1.py, line 952) throws an InvalidCredentialsError when the credentials are correct but the service returns a 503 (The Maximum number of user sessions is reached).

The response error message is clear: The maximum number of user sessions is reached. Unfortunately this implementation does not convey this information to the client.

It would be best if thrown exceptions included the response object.

I think we could add something simple based off the status code; if it's a 401, then the credentials are invalid, otherwise there's a message we need to bubble up to the user.