File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,18 +61,21 @@ private function submit($url, $payload)
6161 CURLOPT_TIMEOUT => $ this ->timeout ,
6262 ));
6363 if (!$ res ) {
64- throw new ProfilerException ('Failed to set cURL options ' );
64+ $ error = curl_errno ($ ch ) ? curl_error ($ ch ) : '' ;
65+ throw new ProfilerException ('Failed to set cURL options ' .($ error ? ': ' .$ error : '' ));
6566 }
6667
6768 $ result = curl_exec ($ ch );
6869 if ($ result === false ) {
69- throw new ProfilerException ('Failed to submit data ' );
70+ $ error = curl_errno ($ ch ) ? curl_error ($ ch ) : '' ;
71+ throw new ProfilerException ('Failed to submit data ' .($ error ? ': ' .$ error : '' ));
7072 }
7173 curl_close ($ ch );
7274
7375 $ response = json_decode ($ result , true );
7476 if (!$ response ) {
75- throw new ProfilerException ('Failed to decode response ' );
77+ $ error = json_last_error () ? (PHP_VERSION_ID >= 50500 ? json_last_error_msg () : 'Error ' .json_last_error ()) : '' ;
78+ throw new ProfilerException ('Failed to decode response ' .($ error ? ': ' .$ error : '' ));
7679 }
7780
7881 if (isset ($ response ['error ' ]) && $ response ['error ' ]) {
You can’t perform that action at this time.
0 commit comments