It is better to switch off CURLOPT_FAILONERROR and check response status manually by HTTP response code