shareplum
shareplum copied to clipboard
Raise specific exception for bad auth.
I'm picturing something like this to give a more informative error message in the case of bad auth. Thoughts?
I see what you're doing there. That looks good. I think we can just keep it in the getuser function since we know it will get called on initialization. You don't need to replace the post() function, its a wrapper for self._session.post(). Can you confirm that this gives the appropriate error on SharePoint 2016?
I had to replace the post() function because the wrapper immediately raises an exception on a 404. In this case, to confirm that it's actually a permission error (rather than the URL not being found, as you would normally interpret a 404), we want to first check that posting to the URL normally receives a 200 OK.
With this merged into the gitlab-ci-yml branch, this is now the error that gets raised when I try to run the tests.