{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/255","repository_url":"https://api.github.com/repos/rust-lang-nursery/rand","labels_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/255/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/255/events","html_url":"https://github.com/rust-lang-nursery/rand/pull/255","id":295488036,"number":255,"title":"ErrorKind: rename Transient → Unexpected and revise uses of Unavailable","user":{"login":"dhardy","id":134893,"avatar_url":"https://avatars1.githubusercontent.com/u/134893?v=4","gravatar_id":"","url":"https://api.github.com/users/dhardy","html_url":"https://github.com/dhardy","followers_url":"https://api.github.com/users/dhardy/followers","following_url":"https://api.github.com/users/dhardy/following{/other_user}","gists_url":"https://api.github.com/users/dhardy/gists{/gist_id}","starred_url":"https://api.github.com/users/dhardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhardy/subscriptions","organizations_url":"https://api.github.com/users/dhardy/orgs","repos_url":"https://api.github.com/users/dhardy/repos","events_url":"https://api.github.com/users/dhardy/events{/privacy}","received_events_url":"https://api.github.com/users/dhardy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-02-08T12:06:52Z","updated_at":"2018-02-22T18:49:35Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/pulls/255","html_url":"https://github.com/rust-lang-nursery/rand/pull/255","diff_url":"https://github.com/rust-lang-nursery/rand/pull/255.diff","patch_url":"https://github.com/rust-lang-nursery/rand/pull/255.patch"},"body":"I've not been happy with the `Transient` error kind for a while, notably because it was never used, and because `Unavailable` was used for errors which just *might* be resolvable on retry. This PR keeps `Unavailable` but replaces most uses with `Unexpected`.\r\n\r\nFurther thoughts:\r\n\r\n*  we could keep `Transient` for cases where we legitimately know there is a good chance of success on retry — although we still have no actual use cases yet, and I suspect mostly it would be handled in the same way as `Unexpected`\r\n*  `Other` is redundant with `Unexpected`, right? Remove?\r\n*  `Unavailable` now has two uses — in `JitterRng` (see comment in PR) and for WASM (which has an auto-failing `OsRng` implementation) — so we really can assume it's irrecoverable when handling."},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/comments/367781506","html_url":"https://github.com/rust-lang-nursery/rand/pull/255#issuecomment-367781506","issue_url":"https://api.github.com/repos/rust-lang-nursery/rand/issues/255","id":367781506,"user":{"login":"pitdicker","id":6255050,"avatar_url":"https://avatars1.githubusercontent.com/u/6255050?v=4","gravatar_id":"","url":"https://api.github.com/users/pitdicker","html_url":"https://github.com/pitdicker","followers_url":"https://api.github.com/users/pitdicker/followers","following_url":"https://api.github.com/users/pitdicker/following{/other_user}","gists_url":"https://api.github.com/users/pitdicker/gists{/gist_id}","starred_url":"https://api.github.com/users/pitdicker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitdicker/subscriptions","organizations_url":"https://api.github.com/users/pitdicker/orgs","repos_url":"https://api.github.com/users/pitdicker/repos","events_url":"https://api.github.com/users/pitdicker/events{/privacy}","received_events_url":"https://api.github.com/users/pitdicker/received_events","type":"User","site_admin":false},"created_at":"2018-02-22T18:49:35Z","updated_at":"2018-02-22T18:49:35Z","author_association":"CONTRIBUTOR","body":"> I'm not against adding a few more categories, but ultimately the only purpose of ErrorKind is to hint at what a handler should do with the error\r\n\r\nYes, you pushed for that in the original issue, and I agree. Doing something meaningful with errors is maybe a pattern that is not common enough in the Rust world...\r\n\r\nWe already picked the names in that direction, with a name that indicates both the 'reason' or 'category' of the error, and a hint of the right way to handle it. `NotReady` indicates it should retry over a while (or manually initialize etc.), `Transient` indicates an immediate retry could help, `Unavailable` indicates you should just give up, and `Other` or `Unexpected` says we have no idea what happened and what you should do about it, although a retry might work.\r\n\r\nI just do not want to drop the 'meaning' part and only have an 'instruction' left."}}
{"actor":{"display_login":"pitdicker"}}