simple-access-layer / source

The core repository of the Simple Access Layer.
https://simple-access-layer.github.io/documentation/
European Union Public License 1.2
2 stars 6 forks source link

Exception raised when SALClient given incorrect credentials could be clearer #64

Open TOFarmer opened 3 years ago

TOFarmer commented 3 years ago

Summary

When invalid credentials are passed to SALClient.authenticate, the exception which is raised is sal.core.exception.InvalidResponse("The server did not return an authentication token"). It would be better if an AuthenticationFailed was raised.

Possible fixes

Ideally _handle_error could be used to address this, but raise an InvalidReponse if the response is both invalid and not a 401 error.