Catch all errors when calling the api