cleanup communicationmanager

This commit is contained in:
kremsy
2015-06-26 11:48:21 +02:00
parent f9fd1ad90b
commit 9760a59836
6 changed files with 42 additions and 17 deletions

View File

@ -262,11 +262,9 @@ class CommunicationManager implements CallbackListener {
$answer = $this->triggerCommuncationCallback($data->method, $data->data);
//Prepare Response
if (!$answer) {
$data = array("error" => true, "data" => "No listener or response on the given Message");
} else if (!array_key_exists("error", $answer) || !array_key_exists("data", $answer)) {
$data = array("error" => true, "data" => "Invalid Response on the Message");
$data = new CommunicationAnswer("No listener or response on the given Message", true);
} else {
$data = array("error" => $answer["error"], "data" => $answer["data"]);
$data = $answer;
}
}