Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a more useful error message on exception #345

Merged
merged 1 commit into from Jul 7, 2014

Conversation

craue
Copy link
Contributor

@craue craue commented Jul 5, 2014

This gives me a more useful error log entry

<pre>ERROR Piwik\Tracker[2014-07-05 12:03:10] [33868] Got invalid response from API request: https://127.0.0.1/piwik/index.php?module=API&amp;method=API.getDefaultMetricTranslations&amp;format=original&amp;serialize=1&amp;trigger=archivephp. Response was &#039;Got invalid response from API request: https://127.0.0.1/piwik/index.php?module=API&amp;method=API.getDefaultMetricTranslations&amp;format=original&amp;serialize=1&amp;trigger=archivephp. Response was &#039;curl_exec: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed. Hostname requested was: 127.0.0.1&#039;&#039;</pre>

instead of

<pre>ERROR Piwik\Tracker[2014-07-05 12:02:06] [03840] Got invalid response from API request: https://127.0.0.1/piwik/index.php?module=API&amp;method=API.getDefaultMetricTranslations&amp;format=original&amp;serialize=1&amp;trigger=archivephp. Response was &#039;Got invalid response from API request: https://127.0.0.1/piwik/index.php?module=API&amp;method=API.getDefaultMetricTranslations&amp;format=original&amp;serialize=1&amp;trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of &#039;memory_limit&#039; in your php.ini file. Please check your Web server Error Log file for more details.&#039;</pre>

because in case of an exception in Http::sendHttpRequestBy, $response is undefined and always empty.

Maybe the entire branch for that dummy message could be removed. Let me know what you think or if I missed something here.

mattab pushed a commit that referenced this pull request Jul 7, 2014
provide a more useful error message on exception
@mattab mattab merged commit fbda5ab into matomo-org:master Jul 7, 2014
@mattab
Copy link
Member

mattab commented Jul 7, 2014

Cheers, that small change will help in many cases!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants