IssueRaiser

So far the best error handling pattern I like is actor based (like Erlang for example), where you usually code the main "happy" path sepa...

So far the best error handling pattern I like is actor based (like Erlang for example), where you usually code the main "happy" path separately, where the business logic is cleanly seen, perhaps the error handling is an external supervisor or monitor process. That works for higher level use cases (like handling http requests, parsing, talking to database) and works especially well with heap isolated concurrency units (processes). Maybe it doesn't work for a language that can interface with hardware drivers ... But still wonder how much of an anti-pattern that would be in Rust -- spawn a separate thread, and then do all the IO, HTTP, XML, RSS parsing in a clean way. Then let it panic and somehow find the reason for panic in the original main thread. Then decide there what to do (exit, log, bubble up failure etc).

Posted by rdtsc on May 14, 2015, 5:37 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.6,500 issues0 comments

hackernews (Other)

So far the best error handling pattern I like is actor based (like Erlang for example), where you usually code the main "happy" path sepa...

rdtscMay 14, 2015, 5:37 PM

So far the best error handling pattern I like is actor based (like Erlang for example), where you usually code the main "happy" path separately, where the business logic is cleanly seen, perhaps the error handling is an external supervisor or monitor process. That works for higher level use cases (like handling http requests, parsing, talking to database) and works especially well with heap isolated concurrency units (processes). Maybe it doesn't work for a language that can interface with hardware drivers ... But still wonder how much of an anti-pattern that would be in Rust -- spawn a separate thread, and then do all the IO, HTTP, XML, RSS parsing in a clean way. Then let it panic and somehow find the reason for panic in the original main thread. Then decide there what to do (exit, log, bubble up failure etc).

Comments (0)

No comments yet. Start the discussion.

Comment on this issue