Function internal_error

  • An internal error is an error caused by implementation details of the interface which prevented the interface from fulfilling its contractual obligations and is thus forced to break the regular flow of the program.

    Many interface contracts may opt for undefined behaviour instead of detecting and reporting these errors. Check the policy of a specific interface for confirmation. Even then, a contract's affirmative policy to report these errors is still limited to the impossible assumption that the logical machine (e.g. CPU) is not susceptible to any faults that could cause a glitch in the outcome.

    If a stateful interface reports an internal error, it is assumed that the exposed interface is damaged. It is then a violation for the interface not to report internal errors on all further function calls. If a repair mechanism is in place, this can either be achieved:

    1. internally, by haulting execution instead of reporting an internal error, and then repairing the damage before resuming execution;
    2. externally, by exposing an additional interface for rebuilding a new fresh interface that is not marked as damaged, once the fault has been repaired;
    3. by considering certain internal defects as part of the exposed state, and converting these errors to state errors.

    This can be a complex decision to make.

    Example omitted because why not.

    Parameters

    • message: any
    • cause: any

    Returns Error

Generated using TypeDoc