Commit 544e5d72 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #332 in ZP/z-push from...

Merge pull request #332 in ZP/z-push from bugfix/ZP-1007-wbxml-in-not-logged-if-requesthandler--handle to develop

* commit '58517e5b':
  ZP-1007 Changed wbxml debug output to FATAL loglevel.
  ZP-1007 Always log Wbxml debug data in case there is an error during RequestHandler->Handle().

Conflicts:
	src/lib/request/requestprocessor.php
parent 324cd15b
......@@ -269,7 +269,7 @@ include_once('version.php');
// This could be a WBXML problem.. try to get the complete request
else if ($ex instanceof WBXMLException) {
ZLog::Write(LOGLEVEL_FATAL, "Request could not be processed correctly due to a WBXMLException. Please report this including WBXML debug data logged. Be aware that the debug data could contain confidential information.");
ZLog::Write(LOGLEVEL_FATAL, "Request could not be processed correctly due to a WBXMLException. Please report this including the 'WBXML debug data' logged. Be aware that the debug data could contain confidential information.");
}
// Try to output some kind of error information. This is only possible if
......
......@@ -128,13 +128,19 @@ abstract class RequestProcessor {
$handler = ZPush::GetRequestHandlerForCommand(Request::GetCommandCode());
// if there is an error decoding wbxml, consume remaining data and include it in the WBXMLException
try {
if (!$handler->Handle(Request::GetCommandCode())) {
throw new WBXMLException(sprintf("Unknown error in %s->Handle()", get_class($handler)));
}
}
catch (Exception $ex) {
$wbxmlLog = "no decoder";
if (self::$decoder) {
self::$decoder->readRemainingData();
$wbxmlLog = self::$decoder->getWBXMLLog();
}
throw new WBXMLException("Debug data: " . $wbxmlLog);
ZLog::Write(LOGLEVEL_FATAL, "WBXML debug data: " . $wbxmlLog, false);
throw $ex;
}
// also log WBXML in happy case
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment