The basic operating system support for exceptions comes from
the TRAP
macro and its variant, TRAPD
, which allow code to be run under a trap harness
the User::Leave()
call, which terminates the current function, and returns to the trap harness, specifying an error code.
These are analogous to C++’s exception handling support (try/catch
and throw
).
By convention, all functions that can leave — directly or indirectly — have an L appended onto their name (and can therefore be referred to as L functions). The function invoked by a trap harness will always be an L function.