async generateError(fetchResponse, exception) {
    const result = (async () => {
      const text = await fetchResponse.text();

      try {
        return JSON.parse(text);
      } catch (e) {
        return text;
      }
    })();

    return {
      status: fetchResponse.status,
      error: exception?.message ?? statusCodes[fetchResponse.status.toString()],
      response: await result,
    };
  }
Generates an error from a Response object
@param {Response} fetchResponse
@private