Iskra API Reference
    Preparing search index...

    Class Responder

    Answers requests by the contract: the Kernel's error handler and 404, and the ok(), list() and fail() helpers, which find it on the context.

    Index
    options: ErrorOptions
    • Answers a thrown error: the Kernel's onError.

      Parameters

      • error: unknown
      • c: Context

      Returns Response | Promise<Response>

    • Parameters

      Returns Response

    • Parameters

      • c: Context
      • data: unknown
      • options: OkOptions = {}

      Returns Response

    • Answers with a problem the caller built (a failed validation, a missing file). Only the contract's log sees it: the caller logs what it must.

      Parameters

      • c: Context
      • found: Problem
      • Optionalerror: unknown

      Returns Response

    • The problem for an error: the contract's toProblem, else Iskra's mapping, with the request id.

      Parameters

      • error: unknown
      • c: Context

      Returns Problem