Comments (12)
This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF2-181
Known GitHub users mentioned in the original message or comment:
@adamlundrigan, @ralphschindler
from zendframework.
Is this still an issue?
from zendframework.
Actually, I think the current behaviour is correct according to the spec, although it is slightly unclear.
Initially I thought that any integer outside of the reserved range was a value error code. However, looking more closely at the spec (http://www.jsonrpc.org/specification#error_object):
- "The error codes from and including -32768 to -32000 are reserved for pre-defined errors."
- -32000 to -32099 Server error Reserved for implementation-defined server-errors.
- The remainder of the space is available for application defined errors.
If application errors are the same as implementation-defined server-errors then the current behaviour is correct. I guess it depends on your interpretation.
from zendframework.
I think it's a mistake to close this ticket. There is a related one here (http://framework.zend.com/issues/browse/ZF-11991) that led to this ticket being opened. It contains more discussion. Perhaps it could be re-opened?
from zendframework.
I agree. The spec is a bit unclear and I've changed my mind again since my last comment. The way I now see it is that application-defined error codes can be any integer outside of the range -32768 to -32000. Zend/Json/Server should prevent applications raising errors with codes in the reserved range but still needs to be able to use the reserved codes in its own operation in order to conform with JSON-RPC.
from zendframework.
That was my interpretation too. The specification is rather fluffy in its use of english.
from zendframework.
I'm one of the main authors of the JSON-RPC 2.0 specification.
The correct interpretation is:
- -32768 to -32000 / pre-defined errors: These error-codes and their meanings are defined by the JSON-RPC 2.0 specification.
- -32099 to -32000 / implementation-defined server-errors: These error-codes can be used for JSON-RPC 2.0 servers/frameworks/libraries for their own errors (e.g. if the JSON-RPC-server itself fails).
- all other codes (>-32000 or <-32768) / application defined errors: These can freely be used by procedures which are called via JSON-RPC.
Hope this helps.
If you have any more questions about JSON-RPC, please mail me or write a mail to the JSON-RPC mailinglist
[email protected].
from zendframework.
Thanks for that clarification rkoe. This issue needs to be re-opened then.
from zendframework.
Excellent thank you. It'd be good to get this into V2.
On 19 Mar 2013, at 18:31, rkoe [email protected] wrote:
I'm one of the main authors of the JSON-RPC 2.0 specification.
The correct interpretation is:-32768 to -32000 / pre-defined errors: These error-codes and their meanings are defined by the JSON-RPC 2.0 specification.
-32099 to -32000 / implementation-defined server-errors: These error-codes can be used for JSON-RPC 2.0 servers/frameworks/libraries for their own errors (e.g. if the JSON-RPC-server itself fails).
all other codes (>-32000 or <-32768) / application defined errors: These can freely be used by procedures which are called via JSON-RPC.
Hope this helps.
If you have any more questions about JSON-RPC, please mail me or write a mail to the JSON-RPC mailinglist
[email protected].—
Reply to this email directly or view it on GitHub.
from zendframework.
Over a year later and nobody has re-opened this bug?
from zendframework.
@Loxrie open a PR with a failing test case
from zendframework.
** And I've just read the source code, it's actually resolved... this becomes painfully obvious when comparing Zend/Json/Server/Error.php between ZF2 and ZF1, where the bug still exists. **
from zendframework.
Related Issues (20)
- Class Methods Hydrator - data not properly populated if object gets bound to form HOT 1
- Db/Sql/Predicate/Expression changes in #6849 introduced a BC break HOT 1
- SMTP SSL Error HOT 1
- Failed loading /home/zaman/Documents/ZendStudio/plugins/com.zend.php.executables.linux_7.1.3.201703171134/resources/ext/./ext/ZendDebugger.so: /home/zaman/Documents/ZendStudio/plugins/com.zend.php.executables.linux_7.1.3.201703171134/resources/ext/./ext/ZendDebugger.so: cannot open shared object file: No such file or directory HOT 1
- PHP-function each() has been deprecated (ZF2)
- A plugin by the name "getServiceLocator" was not found in the plugin manager Zend\Mvc\Controller\PluginManager HOT 5
- This regex may stuck in matching HOT 2
- ZF3 and Apigility 1.5 HOT 1
- Error Handling for a Specific Module Only
- Phone number validation criteria HOT 2
- Session timeout even when user is active HOT 6
- I have changed my files according to issue 5997 but still getting error No translator provided HOT 1
- Function mcrypt_*() is deprecated in Zend/Crypt/Symmetric/Mcrypt.php (ZF2) PHP 7.2 HOT 1
- Why zendframework so tricky? HOT 1
- Use of a broken or else risky cryptographic algorithm md5() in Subscriber.php at line 788 HOT 1
- Question: Advanced Routing HOT 4
- PHP 7.3 compatibility issues for zend-stdlib : Warning: "continue" targeting switch is equivalent to "break". HOT 2
- Strange ZF3 class not found error HOT 3
- CONTRIBUTING.md is not available HOT 1
- Hello , i have an error and need help HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zendframework.