{"action":"created","issue":{"url":"https://api.github.com/repos/edjCase/JsonRpc/issues/29","repository_url":"https://api.github.com/repos/edjCase/JsonRpc","labels_url":"https://api.github.com/repos/edjCase/JsonRpc/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/edjCase/JsonRpc/issues/29/comments","events_url":"https://api.github.com/repos/edjCase/JsonRpc/issues/29/events","html_url":"https://github.com/edjCase/JsonRpc/issues/29","id":174960198,"number":29,"title":"Application defined errors","user":{"login":"hey-red","id":1738743,"avatar_url":"https://avatars.githubusercontent.com/u/1738743?v=3","gravatar_id":"","url":"https://api.github.com/users/hey-red","html_url":"https://github.com/hey-red","followers_url":"https://api.github.com/users/hey-red/followers","following_url":"https://api.github.com/users/hey-red/following{/other_user}","gists_url":"https://api.github.com/users/hey-red/gists{/gist_id}","starred_url":"https://api.github.com/users/hey-red/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hey-red/subscriptions","organizations_url":"https://api.github.com/users/hey-red/orgs","repos_url":"https://api.github.com/users/hey-red/repos","events_url":"https://api.github.com/users/hey-red/events{/privacy}","received_events_url":"https://api.github.com/users/hey-red/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-04T17:38:47Z","updated_at":"2016-09-07T04:20:23Z","closed_at":null,"body":"From [JSON RPC specification](http://www.jsonrpc.org/specification#error_object)\r\nHow to create app defined error response?\r\nThrowing RpcException in user input validation it's bad way. Maybe pass rpc obj through DI and use method like SetErrorResponse in RPC controller?"},"comment":{"url":"https://api.github.com/repos/edjCase/JsonRpc/issues/comments/245170891","html_url":"https://github.com/edjCase/JsonRpc/issues/29#issuecomment-245170891","issue_url":"https://api.github.com/repos/edjCase/JsonRpc/issues/29","id":245170891,"user":{"login":"Gekctek","id":1934953,"avatar_url":"https://avatars.githubusercontent.com/u/1934953?v=3","gravatar_id":"","url":"https://api.github.com/users/Gekctek","html_url":"https://github.com/Gekctek","followers_url":"https://api.github.com/users/Gekctek/followers","following_url":"https://api.github.com/users/Gekctek/following{/other_user}","gists_url":"https://api.github.com/users/Gekctek/gists{/gist_id}","starred_url":"https://api.github.com/users/Gekctek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gekctek/subscriptions","organizations_url":"https://api.github.com/users/Gekctek/orgs","repos_url":"https://api.github.com/users/Gekctek/repos","events_url":"https://api.github.com/users/Gekctek/events{/privacy}","received_events_url":"https://api.github.com/users/Gekctek/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T04:20:23Z","updated_at":"2016-09-07T04:20:23Z","body":"It looks like from the specification (as far as i can tell) that the errors it returns is just about rpc processing except for the -32000 to -32099 range of error codes which can be customized per implementation. I have no way right now to have those be set, but it is a thing I have been thinking about and working on. I plan to have a MVC like way of returning the errors such as returing Ok(responseObject) or BadRequest(\"ErrorMessage\") but havent quite figured it out. The only way to do it right now is to return a wrapper object that holds a result/error code for your request. This is the next thing that I will be implementing."}}
{"actor":{"display_login":"Gekctek"}}