{"action":"created","issue":{"url":"https://api.github.com/repos/perwendel/spark/issues/489","repository_url":"https://api.github.com/repos/perwendel/spark","labels_url":"https://api.github.com/repos/perwendel/spark/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/perwendel/spark/issues/489/comments","events_url":"https://api.github.com/repos/perwendel/spark/issues/489/events","html_url":"https://github.com/perwendel/spark/issues/489","id":141480004,"number":489,"title":"Inaccurate error message when handler returns null","user":{"login":"chrisranderson","id":5461398,"avatar_url":"https://avatars.githubusercontent.com/u/5461398?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisranderson","html_url":"https://github.com/chrisranderson","followers_url":"https://api.github.com/users/chrisranderson/followers","following_url":"https://api.github.com/users/chrisranderson/following{/other_user}","gists_url":"https://api.github.com/users/chrisranderson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisranderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisranderson/subscriptions","organizations_url":"https://api.github.com/users/chrisranderson/orgs","repos_url":"https://api.github.com/users/chrisranderson/repos","events_url":"https://api.github.com/users/chrisranderson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisranderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-17T04:46:46Z","updated_at":"2016-03-22T16:59:43Z","closed_at":null,"body":"Here is the code, x is an object I've created:\r\n\r\n```\r\n post(\"user/login\", (request, response) -> {\r\n           ...\r\n           return x.getResponse(); // *x.getResponse() is null at this point*\r\n});\r\n```\r\n\r\nWhen null is returned, Spark sends a 404 and reports in the console that `The requested route [/user/login] has not been mapped in Spark`. The route was found (so 404 probably isn't correct), and the route has been mapped, it just isn't working correctly. \r\n\r\nP.S. Awesome library! Thank you!"},"comment":{"url":"https://api.github.com/repos/perwendel/spark/issues/comments/199906778","html_url":"https://github.com/perwendel/spark/issues/489#issuecomment-199906778","issue_url":"https://api.github.com/repos/perwendel/spark/issues/489","id":199906778,"user":{"login":"ruurd","id":190727,"avatar_url":"https://avatars.githubusercontent.com/u/190727?v=3","gravatar_id":"","url":"https://api.github.com/users/ruurd","html_url":"https://github.com/ruurd","followers_url":"https://api.github.com/users/ruurd/followers","following_url":"https://api.github.com/users/ruurd/following{/other_user}","gists_url":"https://api.github.com/users/ruurd/gists{/gist_id}","starred_url":"https://api.github.com/users/ruurd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruurd/subscriptions","organizations_url":"https://api.github.com/users/ruurd/orgs","repos_url":"https://api.github.com/users/ruurd/repos","events_url":"https://api.github.com/users/ruurd/events{/privacy}","received_events_url":"https://api.github.com/users/ruurd/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T16:59:43Z","updated_at":"2016-03-22T16:59:43Z","body":"No if get or post are not defined I would return a 405 or a 501. Have a look at HTTP result codes. My point is: if you end up in a condition that you cannot return a valid response, you should define a response that must be returned instead. "}}