Member Junction
    Preparing search index...
    • Narrows an unknown caught value to HttpError — the replacement for axios's isAxiosError.

      Parameters

      • error: unknown

        the value from a catch block.

      Returns error is HttpError

      true when the value is an HttpError, narrowing its type for the caller.

      catch (error) {
      if (IsHttpError(error) && error.Status === 403) { ... }
      throw error; // anything else is not ours to interpret
      }