From 0f4b4e574d83ecda2cd0819afddc3003f923f804 Mon Sep 17 00:00:00 2001 From: Spencer Mortensen Date: Wed, 6 Sep 2017 23:13:57 -0400 Subject: [PATCH] Fixed the code range for implementation-defined server errors --- src/Exception/Implementation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exception/Implementation.php b/src/Exception/Implementation.php index c29606d..30ef7ed 100644 --- a/src/Exception/Implementation.php +++ b/src/Exception/Implementation.php @@ -59,7 +59,7 @@ class Implementation extends JsonRpc\Exception * Integer identifying the type of error that occurred. As the author of a * JSON-RPC 2.0 implementation, you are free to define any custom error code * that you find useful for your implementation, as long as your error code - * falls within the range from -32000 to -32099 inclusive. + * falls within the range from -32099 to -32000 inclusive. * * @param null|boolean|integer|float|string|array $data * An optional primitive value that contains additional information about @@ -89,7 +89,7 @@ public function __construct($code, $data = null) */ private static function isValidCode($code) { - return is_int($code) && (-32000 <= $code) && ($code <= -32099); + return is_int($code) && (-32099 <= $code) && ($code <= -32000); } /**