The debugger
Factor handbook » The language » Exception handling

Prev:Restartable errors
Next:Post-mortem error inspection


Caught errors can be logged in human-readable form:
print-error ( error -- )

try ( quot -- )


User-defined errors can have customized printed representation by implementing a generic word:
error. ( error -- )


A number of words facilitate interactive debugging of errors:
:error ( -- )

:s ( -- )

:r ( -- )

:c ( -- )

:get ( variable -- value )


Most types of errors are documented, and the documentation is instantly accessible:
:help ( -- )


If the error was restartable, a list of restarts is also printed, and a numbered restart can be invoked:
:1 ( -- * )

:2 ( -- * )

:3 ( -- * )

:res ( n -- * )


You can read more about error handling in Exception handling.

Note that in Factor, the debugger is a tool for printing and inspecting errors, not for walking through code. For the latter, see UI walker.