zendframework/zf2 — pull request #5933 by gkralik (2014-03-07 20:53:48+00:00)
Title: Allow arbitrary error codes in JSON RPC server

Currently, the implementation of Zend\Json\Server\Error limits the range of custom error codes from -32000 to -32099. According to the spec (http://www.jsonrpc.org/specification#error_object), this range is "Reserved for implementation-defined server-errors".

The spec continues "The remainder of the space is available for application defined errors". But setting a custom error code (eg 1000) is not allowed by the current implementation and results in the error code being set to -32000.
For a statement of one of the authors of the JSON-RPC specification about usable custom error codes, see [this comment](https://groups.google.com/d/topic/json-rpc/3o2xWBr4FmI/discussion).

This PR aims to change the implementation to allow arbitrary error codes.