Throwing error on authentication failure.