piwik/piwik — pull request #345 by craue (2014-07-05 12:23:20+00:00)
Title: provide a more useful error message on exception

This gives me a more useful error log entry

`

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&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. Response was 'Got invalid response from API request: https://127.0.0.1/piwik/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. Response was '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''

`

instead of

`

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&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. Response was 'Got invalid response from API request: https://127.0.0.1/piwik/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please check your Web server Error Log file for more details.'

`

because in case of an exception, `$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.