ProblemHandler

interface ProblemHandler

A Problem has a ProblemType, indicating its basic nature and severity. This helps a ProblemHandler decide how best to respond to the Problem, such as deciding whether to continue parsing to discover subsequent problems or to give up building the modules.

Author

Mark van Gulik

Inheritors

Functions

Link copied to clipboard
open fun handle(problem: Problem)

Handle the specified problem, continuing or aborting as indicated by the appropriate problem type handler.

Link copied to clipboard
open fun handleExecution(problem: Problem, decider: (Boolean) -> Unit)

A Problem occurred while executing Avail code. Typically this means an unhandled exception, or invoking a bootstrap primitive before the relevant exception handling mechanisms are in place.

Link copied to clipboard
open fun handleExternal(problem: Problem, decider: (Boolean) -> Unit)

An external Problem occurred. This indicates a failure in something outside the control of the virtual machine, for example a disk read failure.

Link copied to clipboard
open fun handleGeneric(problem: Problem, decider: (Boolean) -> Unit)

One of the ProblemType-specific handler methods was invoked, but (1) it was not specifically overridden in the subclass, and (2) this method was not specifically overridden in the subclass. Always fail in this circumstance.

Link copied to clipboard
open fun handleInformation(problem: Problem, decider: (Boolean) -> Unit)

The corresponding Problem is not actually an unexpected condition, but it may still be useful to report the information to the user. It's unclear whether this will actually be used for anything other than debugging the compiler.

Link copied to clipboard
open fun handleInternal(problem: Problem, decider: (Boolean) -> Unit)

An internal Problem occurred in the virtual machine. This should not happen, and is not the fault of the Avail code, but rather Yours Truly, the Avail virtual machine authors.

Link copied to clipboard
open fun handleParse(problem: Problem, decider: (Boolean) -> Unit)

A Problem occurred while parsing a module's body. This includes both malformed tokens and assemblies of tokens that could not be successfully transformed into phrases.

Link copied to clipboard
open fun handleTrace(problem: Problem, decider: (Boolean) -> Unit)

A Problem occurred while tracing a module's dependencies.

Link copied to clipboard
open fun handleWarning(problem: Problem, decider: (Boolean) -> Unit)

The corresponding Problem indicates a situation that is less than ideal. A ProblemHandler may choose to present this warning, and then continue compilation.