6.6 Panic
- Causes: overflow, division by zero, out-of-bounds access,
x!onnone, a contract violation,panic(msg),unreachable(). - A panic terminates the current task, not the process.
defers and destructors are executed. The parentscopereceives the errorPanicked { msg, trace }and the other tasks of the scope are cancelled (§8.5). - A panic in an rpc handler returns
ProtocolError.Internalto the client and is written to the log with a trace. - An unhandled panic of the root task
mainterminates 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