From 6aa733f6c0e934da848f1bd6a44b5e540de75f9d Mon Sep 17 00:00:00 2001 From: Felix Becker Date: Thu, 20 Oct 2016 20:44:56 +0200 Subject: [PATCH] Fix wrong class names --- lib/Dispatcher.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Dispatcher.php b/lib/Dispatcher.php index cac8bcd..d31e53e 100644 --- a/lib/Dispatcher.php +++ b/lib/Dispatcher.php @@ -64,7 +64,7 @@ public function dispatch($msg) if (is_string($msg)) { $msg = json_decode($msg); if (json_last_error() !== JSON_ERROR_NONE) { - throw new ResponseError(json_last_error_msg(), ErrorCode::PARSE_ERROR); + throw new Error(json_last_error_msg(), ErrorCode::PARSE_ERROR); } } // Find out the object and function that should be called @@ -77,7 +77,7 @@ public function dispatch($msg) // the target foreach ($parts as $part) { if (!isset($obj->$part)) { - throw new ResponseError("Method {$msg->method} is not implemented", ErrorCode::METHOD_NOT_FOUND); + throw new Error("Method {$msg->method} is not implemented", ErrorCode::METHOD_NOT_FOUND); } $obj = $obj->$part; } @@ -86,7 +86,7 @@ public function dispatch($msg) $method = new ReflectionMethod($obj, $fn); $this->methods[$msg->method] = $method; } catch (ReflectionException $e) { - throw new ResponseError($e->getMessage(), ErrorCode::METHOD_NOT_FOUND, null, $e); + throw new Error($e->getMessage(), ErrorCode::METHOD_NOT_FOUND, null, $e); } } $method = $this->methods[$msg->method]; @@ -119,7 +119,7 @@ public function dispatch($msg) $args[$position] = $value; } } else { - throw new ResponseError('Params must be structured or omitted', ErrorCode::INVALID_REQUEST); + throw new Error('Params must be structured or omitted', ErrorCode::INVALID_REQUEST); } foreach ($args as $position => $value) { try { @@ -151,11 +151,11 @@ public function dispatch($msg) $class = (string)$type->getValueType()->getFqsen(); $value = $this->mapper->mapArray($value, [], $class); } else { - throw new ResponseError('Type is not matching @param tag', ErrorCode::INVALID_PARAMS); + throw new Error('Type is not matching @param tag', ErrorCode::INVALID_PARAMS); } } } catch (JsonMapper_Exception $e) { - throw new ResponseError($e->getMessage(), ErrorCode::INVALID_PARAMS, null, $e); + throw new Error($e->getMessage(), ErrorCode::INVALID_PARAMS, null, $e); } $args[$position] = $value; }