Endo API documentation
    Preparing search index...

    Function toThrowable

    • After hardening, if specimen is throwable, return it. A specimen is throwable iff it is Passable and contains no PassableCaps, i.e., no Remotables or Promises. IOW, if it contains only copy-data and passable errors.

      Otherwise, if specimen is almost throwable, for example, it is an error that can be made throwable by toPassableError, then return specimen converted to a throwable.

      Otherwise, throw a diagnostic indicating a failure to coerce.

      This is in support of the exo boundary throwing only throwables, to ease security review.

      TODO Adopt a more flexitble notion of throwable, in which data containers containing non-passable errors can themselves be coerced to throwable by coercing to a similar containers containing the results of coercing those errors to passable errors.

      Parameters

      • specimen: unknown

      Returns Passable<never, Error>