MOBILE-193 Improve error handling on authentication