Pebble App Framework: Phone API
    Preparing search index...

    Function fetchFailure

    • Sorts what fetchText threw, what the runtime's fetch rejected with, or the error text pluginRequest answered, into one of the FetchFailureKinds.

      fetchText throws HTTP <status> for an answer that is not 2xx, which reads as HTTP and the status. The Pebble app's own fetch rejects every failure as a TypeError whose message is fetch failed:, fetch timeout:, or fetch abort: and the URL, with no TimeoutError or AbortError name, so the message is read as well as the name. A timeout or an abort is TIMEOUT. Its refusal of a site the wearer has not allowed is an Error named NotAllowedError, raised before the request leaves, which is NOT_ALLOWED. Anything else is FAILED.

      Text is read as pluginRequest's answer. http 429 in either case is HTTP and the status, timeout is TIMEOUT, NETWORK_ERROR is NOT_ALLOWED, and any other text, FETCH_FAILED included, is FAILED. The NETWORK_ERROR reading holds for pluginRequest alone.

      Parameters

      • error: unknown

        What was thrown or answered, which may be anything.

      Returns FetchFailure

      The kind, and the status for HTTP.