@metreeca/tile
    Preparing search index...

    Fault queue.

    Holds the faults raised against an interface, oldest first: any component raises one, a reader clears it once shown.

    Raising and clearing leave this queue untouched and return a new one, so faults read earlier stay as they were. A call that changes nothing returns this same queue, which a rendering layer takes as nothing to redraw.

    interface Faults {
        faults: readonly Fault[];
        raise(issue: unknown): this;
        clear(faults?: Some<Fault>): this;
    }
    Index
    faults: readonly Fault[]

    The faults raised against the interface, oldest first; empty if there are none.

    • Raises an issue.

      Takes the issue as caught, from a rejected exchange, a broken script or an unhandled rejection alike:

      • problem details, that is an object carrying at least one of type, title, status, detail, instance or report, are kept as they are, so a fault reported by success keeps the status and the explanation its source gave it
      • an Error becomes status 0, with its name as title and its message as detail, the stack left out as a fault is expected to travel beyond the page that raised it
      • anything else becomes status 0, carried as report if it is JSON data and as detail otherwise

      Every issue counts as a new one: raising the same issue twice leaves two faults in the queue, each with an instance of its own, whatever the source supplied, because two failed attempts are not one.

      Parameters

      • issue: unknown

        The issue as it was caught

      Returns this

      A queue holding these faults and the one raised from issue last, less the oldest beyond the limit

    • Clears faults.

      Clears the given faults alone, leaving those another reader has yet to show, and ignores any already cleared.

      Parameters

      • Optionalfaults: Some<Fault>

        The faults to clear; every fault in the queue if omitted

      Returns this

      A queue without faults, or empty if faults is omitted; this same queue if nothing is cleared