Commit bafa51ea 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().
parents 6acb4a87 58517e5b
...@@ -207,7 +207,7 @@ include_once(ZPUSH_CONFIG); ...@@ -207,7 +207,7 @@ include_once(ZPUSH_CONFIG);
// This could be a WBXML problem.. try to get the complete request // This could be a WBXML problem.. try to get the complete request
else if ($ex instanceof WBXMLException) { 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 // Try to output some kind of error information. This is only possible if
......
...@@ -124,8 +124,14 @@ abstract class RequestProcessor { ...@@ -124,8 +124,14 @@ abstract class RequestProcessor {
$handler = ZPush::GetRequestHandlerForCommand(Request::GetCommandCode()); $handler = ZPush::GetRequestHandlerForCommand(Request::GetCommandCode());
// if there is an error decoding wbxml, consume remaining data and include it in the WBXMLException // if there is an error decoding wbxml, consume remaining data and include it in the WBXMLException
if (!$handler->Handle(Request::GetCommandCode())) { try {
throw new WBXMLException("Debug data: " . Request::GetInputAsBase64()); if (!$handler->Handle(Request::GetCommandCode())) {
throw new WBXMLException(sprintf("Unknown error in %s->Handle()", get_class($handler)));
}
}
catch (Exception $ex) {
ZLog::Write(LOGLEVEL_FATAL, "WBXML debug data: " . Request::GetInputAsBase64(), false);
throw $ex;
} }
// also log WBXML in happy case // 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