Setu-TS
    Preparing search index...

    Function httpStatusHintOf

    • Reads the status hint an error was branded with.

      Accepts unknown rather than Error because the one caller that matters — an error-handling catch — holds unknown, and a thrown non-Error value is legal JavaScript.

      Parameters

      • error: unknown

        The thrown value to inspect

      Returns HttpStatusHint | undefined

      The hint, or undefined when the value carries none

      try {
      await repo.findAll(query);
      } catch (error) {
      const hint = httpStatusHintOf(error);
      if (hint !== undefined) {
      // Answer hint.status with hint.detail rather than a masked 500.
      }
      }

      0.4.0