garrytan/gstack · error

API error (${response.status}): ${error.slice(0, 200)}

Error message

API error (${response.status}): ${error.slice(0, 200)}

What it means

Error "API error (${response.status}): ${error.slice(0, 200)}" thrown in garrytan/gstack.

Source

Thrown at design/src/design-to-code.ts:79

  "colors": ["#hex - usage", ...],
  "typography": ["role: family, size, weight", ...],
  "layout": ["description of layout pattern", ...],
  "components": ["component name - description", ...]
}

Be specific about every visual detail: exact hex colors, font sizes in px, spacing values, border-radius, shadows. The developer should be able to implement this without looking at the mockup again.${contextBlock}`,
            },
          ],
        }],
        max_tokens: 1000,
        response_format: { type: "json_object" },
      }),
      signal: controller.signal,
    });

    if (!response.ok) {
      const error = await response.text();
      throw new Error(`API error (${response.status}): ${error.slice(0, 200)}`);
    }

    const data = await response.json() as any;
    const content = data.choices?.[0]?.message?.content?.trim() || "";
    return JSON.parse(content) as DesignToCodeResult;
  } finally {
    clearTimeout(timeout);
  }
}

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at design/src/design-to-code.ts:79 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/a45459edc2348df0. Report an issue: GitHub.