{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1909","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1909/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1909/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1909/events","html_url":"https://github.com/manastech/crystal/pull/1909","id":119034467,"number":1909,"title":"Added a block argument to at_exit","user":{"login":"MakeNowJust","id":6679325,"avatar_url":"https://avatars.githubusercontent.com/u/6679325?v=3","gravatar_id":"","url":"https://api.github.com/users/MakeNowJust","html_url":"https://github.com/MakeNowJust","followers_url":"https://api.github.com/users/MakeNowJust/followers","following_url":"https://api.github.com/users/MakeNowJust/following{/other_user}","gists_url":"https://api.github.com/users/MakeNowJust/gists{/gist_id}","starred_url":"https://api.github.com/users/MakeNowJust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakeNowJust/subscriptions","organizations_url":"https://api.github.com/users/MakeNowJust/orgs","repos_url":"https://api.github.com/users/MakeNowJust/repos","events_url":"https://api.github.com/users/MakeNowJust/events{/privacy}","received_events_url":"https://api.github.com/users/MakeNowJust/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-26T12:18:50Z","updated_at":"2015-11-26T13:28:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/manastech/crystal/pulls/1909","html_url":"https://github.com/manastech/crystal/pull/1909","diff_url":"https://github.com/manastech/crystal/pull/1909.diff","patch_url":"https://github.com/manastech/crystal/pull/1909.patch"},"body":"This feature becomes able to check an error in a `at_exit` block. It is useful to run your code when main script finished. See [kemal.cr](https://github.com/sdogruyol/kemal/blob/master/src/kemal.cr) for example. It uses `at_exit` to starts a HTTP server after main script. It is good. However, it starts the server even if main script failed. I think this behavior is wrong. If this PR is merged, I will fix like following code.\r\n\r\n```crystal\r\nat_exit do |status|\r\n  if status == 0\r\n    # starting server process here\r\n    # ...\r\n  end\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/159911957","html_url":"https://github.com/manastech/crystal/pull/1909#issuecomment-159911957","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1909","id":159911957,"user":{"login":"asterite","id":209371,"avatar_url":"https://avatars.githubusercontent.com/u/209371?v=3","gravatar_id":"","url":"https://api.github.com/users/asterite","html_url":"https://github.com/asterite","followers_url":"https://api.github.com/users/asterite/followers","following_url":"https://api.github.com/users/asterite/following{/other_user}","gists_url":"https://api.github.com/users/asterite/gists{/gist_id}","starred_url":"https://api.github.com/users/asterite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asterite/subscriptions","organizations_url":"https://api.github.com/users/asterite/orgs","repos_url":"https://api.github.com/users/asterite/repos","events_url":"https://api.github.com/users/asterite/events{/privacy}","received_events_url":"https://api.github.com/users/asterite/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T13:28:53Z","updated_at":"2015-11-26T13:28:53Z","body":"Looks good. How would you handle the same situation in Ruby?"}}