Generally, there are two kinds of error handling among all programming langauges:
- Create a scope, anything does wrong during execution will ternimate the scope and jump to the error handling part, e.g.
try-catch
,superviser with actors
. This style is usually preferrable with scripting. - Error is explicitly passed to caller, and encourage explicit handling of every single error, e.g. Go, C, node.js with callbacks. And this is very useful in critical systems as every error matters.