graze / guzzle-jsonrpc

JSON-RPC 2.0 client for Guzzle
https://packagist.org/packages/graze/guzzle-jsonrpc
MIT License
93 stars 61 forks source link

Error code accepted range #2

Closed famzah closed 10 years ago

famzah commented 10 years ago

The current implementation accepts only the following error codes:

array_merge(array(-32700), range(-32600, -32603), range(-32000, -32099))

This is the source code from "JsonRpc/Message/ErrorResponse.php".

However, the JSON-RPC specification allows any integer. See (http://www.jsonrpc.org/specification) which says: "5.1 Error object -> code -> A Number that indicates the error type that occurred. This MUST be an integer."

That's all. After that a few reserved codes for pre-defined errors are listed. It seems that you've misinterpreted those reserved codes as the only one which are accepted. While actually, those reserved codes should be used as specified and "the remainder of the space is available for application defined errors."

Please allow us to use arbitrary integer error codes in our applications.

adlawson commented 10 years ago

Thanks, @famzah :+1: