Error handling extractor.
Detects error handling patterns and anti-patterns in BEAM bytecode: bare rescues (catch-all without filtering or reraising), trap_exit without handlers, explicit exit calls, and ignored error results.
Approach
For bare rescue detection, walks forward from try_start handler labels.
If the handler code contains no test/select_val filtering exception
class and no :erlang.raise/3 call, it's a bare rescue that silently
swallows exceptions.
Emitted facts
bare_rescue(id, func)— catch-all rescue without filtering or reraisingtrap_exit(func, mod)—Process.flag(:trap_exit, true)call siteexit_call(id, func, target)— explicitProcess.exit/2or:erlang.exit/1,2ignored_error_result(id, func, callee)— call to known ok/error API where result is not pattern matchedcatch_total(id, func, class)— some clause catchesclasswithout a pattern on the reasoncatch_tag(id, func, class, tag)— an atom a clause catchingclasscompares against (its reason pattern, or acasein its body);rescue Xyields the struct nameXcatch_falls_through(id, func, tag)— acaseinside the handler, reached after comparingtag, has no clause for some value, so an unexpected reason is a CaseClauseErrortry_call(id, func, callee)— a peer call (GenServer.call,:gen_statem.call,:erpc.call, ...) thetryatidguardsmailbox_writer(id, func, kind)— a call after which something other than a peer's request lands in this process's mailbox:task(a Task.async reply),timer(send_after / send_interval),pubsub(a subscription),self(the function sends to self()),apply(the function runs a caller-supplied function, which may do anything with this mailbox — the Flow producer of gen_stage#238 ran user code that called hackney)