{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/5399","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/5399/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/5399/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/5399/events","html_url":"https://github.com/laravel/framework/issues/5399","id":39900901,"number":5399,"title":"Wrong error code from findOrFail","user":{"login":"grosch","id":315966,"avatar_url":"https://avatars.githubusercontent.com/u/315966?v=3","gravatar_id":"","url":"https://api.github.com/users/grosch","html_url":"https://github.com/grosch","followers_url":"https://api.github.com/users/grosch/followers","following_url":"https://api.github.com/users/grosch/following{/other_user}","gists_url":"https://api.github.com/users/grosch/gists{/gist_id}","starred_url":"https://api.github.com/users/grosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grosch/subscriptions","organizations_url":"https://api.github.com/users/grosch/orgs","repos_url":"https://api.github.com/users/grosch/repos","events_url":"https://api.github.com/users/grosch/events{/privacy}","received_events_url":"https://api.github.com/users/grosch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-08-10T04:41:07Z","updated_at":"2016-03-16T16:55:55Z","closed_at":"2014-08-11T15:13:37Z","body":"When I call findOrFail() on my model, it's returning a 500 status code, which I think is wrong.  The 4xx status codes mean the client did something wrong, whereas the 5xx mean the server did something wrong but the client's request was perfectly valid.  In this case, the client sent a technically invalid request as they asked for something that doesn't exist.  The server didn't have an issue, so a 500 shouldn't be sent back, but rather a 404, right?"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/197422496","html_url":"https://github.com/laravel/framework/issues/5399#issuecomment-197422496","issue_url":"https://api.github.com/repos/laravel/framework/issues/5399","id":197422496,"user":{"login":"fndmiranda","id":2773328,"avatar_url":"https://avatars.githubusercontent.com/u/2773328?v=3","gravatar_id":"","url":"https://api.github.com/users/fndmiranda","html_url":"https://github.com/fndmiranda","followers_url":"https://api.github.com/users/fndmiranda/followers","following_url":"https://api.github.com/users/fndmiranda/following{/other_user}","gists_url":"https://api.github.com/users/fndmiranda/gists{/gist_id}","starred_url":"https://api.github.com/users/fndmiranda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fndmiranda/subscriptions","organizations_url":"https://api.github.com/users/fndmiranda/orgs","repos_url":"https://api.github.com/users/fndmiranda/repos","events_url":"https://api.github.com/users/fndmiranda/events{/privacy}","received_events_url":"https://api.github.com/users/fndmiranda/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T16:55:54Z","updated_at":"2016-03-16T16:55:54Z","body":"The following page of the documentation which talks about the customization of errors:\r\nhttps://laravel.com/docs/master/errors#the-exception-handler"}}