Commit ca2ede24 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1007 Always log Wbxml debug data in case there is an error during

RequestHandler->Handle().

Released under the Affero GNU General Public License (AGPL) version 3.
parent b609f931
......@@ -207,7 +207,7 @@ include_once(ZPUSH_CONFIG);
// 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
......
......@@ -124,8 +124,14 @@ abstract class RequestProcessor {
$handler = ZPush::GetRequestHandlerForCommand(Request::GetCommandCode());
// if there is an error decoding wbxml, consume remaining data and include it in the WBXMLException
if (!$handler->Handle(Request::GetCommandCode())) {
throw new WBXMLException("Debug data: " . Request::GetInputAsBase64());
try {
if (!$handler->Handle(Request::GetCommandCode())) {
throw new WBXMLException(sprintf("Unknown error in %s->Handle()", get_class($handler)));
}
}
catch (Exception $ex) {
ZLog::Write(LOGLEVEL_ERROR, "WBXML debug data: " . Request::GetInputAsBase64(), 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