@metreeca/http - v0.4.1
    Preparing search index...

    Function toProblem

    • Converts a value to a Problem.

      Normalises whatever a failed exchange surfaces into a single shape callers may branch on:

      • a value already qualifying as a Problem is taken as it stands
      • an Error contributes its name as title and its message as detail
      • any other JSON value is carried as report
      • anything else is rendered as detail

      Values other than problems are assigned status 0, marking a failure no origin server assigned a status to.

      Stack traces and causes are left out, as a problem is expected to travel beyond the process that raised it.

      Parameters

      • value: unknown

        The value to convert

      Returns Problem

      An immutable Problem describing value