error handling for cloud API errors