log response on failed reports

This commit is contained in:
Steffen Schröder 2014-05-24 21:49:17 +02:00
parent 8822c79108
commit 2666d8b616

View File

@ -84,13 +84,13 @@ class ErrorHandler {
$json = json_encode($report); $json = json_encode($report);
$info = base64_encode($json); $info = base64_encode($json);
$url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info); $url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info);
$success = FileUtil::loadFile($url); $response = FileUtil::loadFile($url);
$success = json_decode($response);
if (!json_decode($success)) { if ($success) {
logMessage('Exception-Report failed!');
} else {
logMessage('Exception successfully reported!'); logMessage('Exception successfully reported!');
} else {
logMessage('Exception-Report failed! ' . print_r($response, true));
} }
} }
@ -249,13 +249,13 @@ class ErrorHandler {
$json = json_encode($report); $json = json_encode($report);
$info = base64_encode($json); $info = base64_encode($json);
$url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info); $url = ManiaControl::URL_WEBSERVICE . 'errorreport?error=' . urlencode($info);
$success = FileUtil::loadFile($url); $response = FileUtil::loadFile($url);
$success = json_decode($success); $success = json_decode($response);
if ($success) { if ($success) {
logMessage('Error successfully reported!'); logMessage('Error successfully reported!');
} else { } else {
logMessage('Error-Report failed!'); logMessage('Error-Report failed! ' . print_r($response, true));
} }
} }
if ($this->shouldStopExecution($errorNumber)) { if ($this->shouldStopExecution($errorNumber)) {