garrytan/gstack · error

HTTP ${response.status()}

Error message

HTTP ${response.status()}

What it means

Error "HTTP ${response.status()}" thrown in garrytan/gstack.

Source

Thrown at browse/src/write-commands.ts:1377

      const manifest: any = {
        url: page.url(),
        scraped_at: new Date().toISOString(),
        files: [] as any[],
        total_size: 0,
        succeeded: 0,
        failed: 0,
      };

      const lines: string[] = [];
      for (let i = 0; i < toDownload.length; i++) {
        const { url, type } = toDownload[i];
        try {
          // Same gate as the download command — page.request.fetch
          // must not reach cloud metadata, ULA ranges, or the rest of
          // the blocklist. See url-validation.ts for the full list.
          await validateNavigationUrl(url);
          const response = await page.request.fetch(url, { timeout: 30000 });
          if (response.status() >= 400) throw new Error(`HTTP ${response.status()}`);
          const ct = response.headers()['content-type'] || 'application/octet-stream';
          const ext = mimeToExt(ct.split(';')[0].trim());
          const filename = `${type}-${String(i + 1).padStart(3, '0')}${ext}`;
          const filePath = path.join(dir, filename);
          const body = Buffer.from(await response.body());
          try {
            fs.writeFileSync(filePath, body);
          } catch (writeErr: any) {
            throw new Error(`Disk write failed: ${writeErr.message}`);
          }
          manifest.files.push({ path: filename, src: url, size: body.length, type: ct.split(';')[0].trim() });
          manifest.total_size += body.length;
          manifest.succeeded++;
          lines.push(`  [${i + 1}/${toDownload.length}] ${filename} (${Math.round(body.length / 1024)}KB)`);
        } catch (err: any) {
          manifest.files.push({ path: null, src: url, size: 0, type: '', error: err.message });
          manifest.failed++;
          lines.push(`  [${i + 1}/${toDownload.length}] FAILED: ${err.message}`);

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at browse/src/write-commands.ts:1377 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/a441527611828b5c. Report an issue: GitHub.