diff --git a/src/Exception/Evaluation.php b/src/Exception/Evaluation.php index 73669a2..4871c2a 100644 --- a/src/Exception/Evaluation.php +++ b/src/Exception/Evaluation.php @@ -44,7 +44,8 @@ public function __construct($message = '', $code = 0) private static function isValidCode($code) { - return is_int($code) && (($code < -32768) || (-32000 < $code)); + // as defined by the JSON-RPC 2.0 spec, see http://www.jsonrpc.org/specification#error_object + return is_int($code) && (-32768 <= $code && $code <= -32000); } private static function isValidMessage($message)