Improved OAuth exception handling