Skip to content

Commit

Permalink
fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnrc committed Dec 24, 2015
1 parent d17cdcb commit cbbe5ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Exception/Evaluation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit cbbe5ff

@smortensen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Shawn, it turns out the original code was right! The JSON-RPC 2.0 specifications were designed to follow the XML-RPC specifications, where the explanation is clearer:
http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php

I've updated the documentation to clear up any confusion caused by the JSON-RPC 2.0 specifications document. Thank you for bringing this up!

Please sign in to comment.