{"action":"published","release":{"url":"https://api.github.com/repos/expede/exceptional/releases/4949935","assets_url":"https://api.github.com/repos/expede/exceptional/releases/4949935/assets","upload_url":"https://uploads.github.com/repos/expede/exceptional/releases/4949935/assets{?name,label}","html_url":"https://github.com/expede/exceptional/releases/tag/1.3.0","id":4949935,"tag_name":"1.3.0","target_commitish":"master","name":"Make dangerous functions safe","draft":false,"author":{"login":"expede","id":1052016,"avatar_url":"https://avatars.githubusercontent.com/u/1052016?v=3","gravatar_id":"","url":"https://api.github.com/users/expede","html_url":"https://github.com/expede","followers_url":"https://api.github.com/users/expede/followers","following_url":"https://api.github.com/users/expede/following{/other_user}","gists_url":"https://api.github.com/users/expede/gists{/gist_id}","starred_url":"https://api.github.com/users/expede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/expede/subscriptions","organizations_url":"https://api.github.com/users/expede/orgs","repos_url":"https://api.github.com/users/expede/repos","events_url":"https://api.github.com/users/expede/events{/privacy}","received_events_url":"https://api.github.com/users/expede/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2016-12-18T04:25:04Z","published_at":"2016-12-18T04:25:51Z","assets":[],"tarball_url":"https://api.github.com/repos/expede/exceptional/tarball/1.3.0","zipball_url":"https://api.github.com/repos/expede/exceptional/zipball/1.3.0","body":"`safe/1` & `safe/2` (plus pun aliases: `lower/1` and `lower/2` make functions that raise exceptions return those exceptions instead.\r\n\r\nDoes not catch `throw`s, because that causes all sorts of odd behaviour (REPL errors returned as tuples or (structs if normalized), then they get piped into functions... all sorts of mess).\r\n\r\n```elixir\r\ntoothless_fetch = safe(&Enum.fetch!/2)\r\n[1,2,3] |> toothless_fetch.(1)\r\n#=> 2\r\n\r\ntoothless = safe(&Enum.fetch!/2)\r\n[1,2,3] |> toothless.(999)\r\n#=> %Enum.OutOfBoundsError{message: \"out of bounds error\"}\r\n\r\nsafe(&Enum.fetch!/2).([1,2,3], 999)\r\n#=> %Enum.OutOfBoundsError{message: \"out of bounds error\"}\r\n```"}}
{"actor":{"display_login":"expede"}}