Skip to content

Commit

Permalink
Fixed the code range for implementation-defined server errors
Browse files Browse the repository at this point in the history
  • Loading branch information
smortensen committed Sep 7, 2017
1 parent 597e946 commit 0f4b4e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Exception/Implementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 0f4b4e5

Please sign in to comment.