Function fetchWithTimeout

  • Wraps fetch with optional timeout handling and improved error messages.

    Parameters

    • url: string | URL

      Request URL or URL object to fetch

    • options: FetchWithTimeoutOptions = {}

      Optional request options including timeout, label, and signal

    Returns Promise<Response>

    The Response object from the request