Improved error handling for rate limit errors