This should catch the more specific exceptions thrown by the AI API.