ZF-8725: Zend_Json_Server_Error does not allow application-defined error codes
According to the JSON-RPC http://groups.google.com/group/json-rpc/… , error codes -32768 - -32000 are reserved for JSON-RPC server errors, but all other codes are valid for application-defined use. Currently Zend_Json_Server_Error only allows for server errors to be reported, converting all application errors to -32000.
This is quite obvious in Zend_Server_Json->fault() where the default code is '404', but is instantly converted to -32000 by Zend_Server_Json_Error.
It seems like the resolution should be to drop the current allowedCodes strategy, and simply check that the error code is an integer.