Improved error handling for rate limits