I assume that S3 still returns 401 if you don't have the necessary permissions and the container doesn't exist?

If that is indeed the case, I wonder if just throwing here might be better / more correct.