OxL Reference

6.6 Panic

  • Causes: overflow, division by zero, out-of-bounds access, x! on none, a contract violation, panic(msg), unreachable().
  • A panic terminates the current task, not the process. defers and destructors are executed. The parent scope receives the error Panicked { msg, trace } and the other tasks of the scope are cancelled (§8.5).
  • A panic in an rpc handler returns ProtocolError.Internal to the client and is written to the log with a trace.
  • An unhandled panic of the root task main terminates the process with exit code 101.
  • A build profile MAY set panic = "abort" — then a panic terminates the process.

See also

Source: docs/spec/oxl-standard.en.md