{"comment":{"url":"https://api.github.com/repos/ArtemGr/rust-scgi/comments/12122154","html_url":"https://github.com/ArtemGr/rust-scgi/commit/d9afc593ad4083d031f649a180ab0d54dd2fdd26#commitcomment-12122154","id":12122154,"user":{"login":"ArtemGr","id":41847,"avatar_url":"https://avatars.githubusercontent.com/u/41847?v=3","gravatar_id":"","url":"https://api.github.com/users/ArtemGr","html_url":"https://github.com/ArtemGr","followers_url":"https://api.github.com/users/ArtemGr/followers","following_url":"https://api.github.com/users/ArtemGr/following{/other_user}","gists_url":"https://api.github.com/users/ArtemGr/gists{/gist_id}","starred_url":"https://api.github.com/users/ArtemGr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArtemGr/subscriptions","organizations_url":"https://api.github.com/users/ArtemGr/orgs","repos_url":"https://api.github.com/users/ArtemGr/repos","events_url":"https://api.github.com/users/ArtemGr/events{/privacy}","received_events_url":"https://api.github.com/users/ArtemGr/received_events","type":"User","site_admin":false},"position":27,"line":16,"path":"src/example.rs","commit_id":"d9afc593ad4083d031f649a180ab0d54dd2fdd26","created_at":"2015-07-12T09:47:56Z","updated_at":"2015-07-12T09:47:56Z","body":"> Anyway, remember you are in a spawn()ed thread here, so you can safely panic with unwrap(), and your error will be printed into stderr by panic handler.\r\n\r\nThat's certainly not the kind of behavious I want users of this crate to have as default. Errors should be handled and I want the error handling to remain transparent.\r\n\r\n> Another approach would be macro like try_\r\n> I think it's more clean this way.\r\n\r\nI don't. It goes against the KISS principle (a user will have to keep a new abstraction in mind just to read the code) and it will make the example harder to incorporate into a program.\r\n\r\n> Another options is to use [catch_panic()][http://doc.rust-lang.org/stable/std/thread/fn.catch_panic.html] if you are eager enough to use unstable features.\r\n\r\nThis crates builds on stable so far, including the example.\r\n\r\n> Anyway, it's up to you. Maybe I'm wrong here and you just invented new Rust approach to error handling =)\r\n\r\nI think I did invented an approach and posted it in the earlier discussions of error handling in `main`, but it's been some time ago so I probably wouldn't find it.\r\n\r\nThe trick of using closures for error handling goes back to C++11 trick of using them for variable initialization."}}