{"issue":{"title":"Send 500 when Handler:handle is failing","user":{"login":"erlyvideo","id":170474,"url":"https://api.github.com/users/erlyvideo","gravatar_id":"2d87b5fdaeb0f475bfb0d9f60dd165ee","avatar_url":"https://secure.gravatar.com/avatar/2d87b5fdaeb0f475bfb0d9f60dd165ee?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-23T18:47:37Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-24T20:41:31Z","id":2649474,"pull_request":{"patch_url":"https://github.com/extend/cowboy/pull/114.patch","html_url":"https://github.com/extend/cowboy/pull/114","diff_url":"https://github.com/extend/cowboy/pull/114.diff"},"closed_at":null,"html_url":"https://github.com/extend/cowboy/issues/114","body":"Currently cowboy just closes connection. It is a bad idea, better to send 500.","number":114,"url":"https://api.github.com/repos/extend/cowboy/issues/114","comments":10,"assignee":null},"comment":{"user":{"login":"klaar","id":41672,"url":"https://api.github.com/users/klaar","gravatar_id":"1514e5da985d4fd1ecdfc4b5b1f6d84f","avatar_url":"https://secure.gravatar.com/avatar/1514e5da985d4fd1ecdfc4b5b1f6d84f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-24T20:41:31Z","updated_at":"2011-12-24T20:41:31Z","id":3269002,"body":"I second @erlyvideo on making cowboy_http_req:reply/N lazy being a bad idea, it would break the current behavior of the http handler interface, it is quite low level and makes few promises. This works in favor of building more high level interfaces like the rest handler. I agree that adding a workaround for this is worthwhile though, who hasn't crashed in Handler:handle at least _once_?\r\n\r\nI don't see any reason for using a global ETS table over the process dictionary in this case, in the current HTTP protocol implementation the behavior is undefined when running multiple handlers within the same process, the same goes for sending a request term to a different process. If we're going to use shared/mutable state, isn't it better to put it somewhere where we are _guaranteed_ that the data is freed on exit first. We can defer the added complexity of global identifiers and ETS tables until we're actually implementing a feature that needs this.","url":"https://api.github.com/repos/extend/cowboy/issues/comments/3269002"},"action":"created"}