Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Issue4817 #4818

Closed
wants to merge 6 commits into from
Closed

Issue4817 #4818

wants to merge 6 commits into from

Conversation

tylkomat
Copy link

Fix for #4817

@mwillbanks
Copy link
Contributor

Could you please provide some more detail in this PR? I did look at the other issue but some sources and other items would be great :)

@tylkomat
Copy link
Author

Ah sure. Following this specification www.jsonrpc.org/specification the Error Code for a parse error should be -32700. This error should be sent when the JSON sent to the service is malformed. An example from the same page:
A request {"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz] should create this response: {"jsonrpc": "2.0", "error": {"code": -32700, "message": "Parse error"}, "id": null}

Before my PR the JSON parser just threw an unhandled exception which in this case is not desired and should be handled. Like the already existing isMethodError function I created an ìsParseError function so the Zend\Json\Server\Server can check in the Zend\Json\Server\Request object for it and create a proper Zend\Json\Server\Response.

@ghost ghost assigned weierophinney Jul 17, 2013
weierophinney added a commit that referenced this pull request Jul 17, 2013
weierophinney added a commit that referenced this pull request Jul 17, 2013
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants