Improve error handling during auth.