GlyphfieldDocs
Documentation/System reference

Errors and limits

Handle validation responses, request limits, content types, and retries safely.

Maintained with source

Validation failures use a structured response:

{
  "error": {
    "code": "invalid_request",
    "field": "settings.width",
    "message": "settings.width must be an integer between 64 and 4096."
  },
  "schemaVersion": 1
}

Status codes

StatusMeaningResponse
400Malformed JSON or invalid fieldCorrect the named field
413Request body exceeds 5 MBReduce or recompress embedded assets
415Content-Type is not JSONSend Content-Type: application/json
429Production request rate limit exceededWait for the limit window before retrying
500Artifact generation failedLog the response and retry only if appropriate

Retry policy

Do not retry an unchanged validation request. Read error.field, correct the input, and submit a new request. Unknown top-level request fields fail with unknown_field rather than silently falling back to defaults.

For 429, stop concurrent work and wait for the rate-limit window. Do not fan out retries.

For transient 5xx responses, use bounded exponential backoff and retain the original request for diagnosis. Generation is deterministic for the same contract and inputs.

Important limits

  • Request body: 5 MB maximum
  • Data URL asset: 5 MB maximum
  • Background width and height: 64–4096
  • Background total pixels: 12,000,000 maximum
  • Template title: 240 characters
  • Template body: 1000 characters
  • Remote asset URLs: unsupported

Contract drift

Always read GET /api/generate and check schemaVersion. If the schema version is unknown, stop and update the client rather than silently guessing.

Browser API failures

Browser automation uses JavaScript errors rather than HTTP status codes:

ErrorTypical causeResponse
TypeErrorMalformed action input, unsupported source, wrong control value, empty artifactCorrect the input; do not retry unchanged
RangeErrorAccessible control label or action is not exposed by the active adapterRe-read describe() and controls(); confirm the active tool
Error from a rendererWebGL context, image decode, Canvas, GIF, MP4, font, or codec failurePreserve source, capture the exact capability failure, retry only when conditions changed

After a tool switch, the global adapter is replaced. A stale reference can report the old action set or mutate the wrong tool. Wait for glyphfield:studio-api-ready and re-read window.glyphfield.studio.

Do not swallow export errors and report success because the source was valid. A valid document and a rendered file are separate completion checkpoints.

Recovery-safe behavior

When rendering fails after source application:

  1. Re-read the source and retain it.
  2. Record activeTool(), describe(), browser capability, requested format, dimensions, and action.
  3. Stop sequence preview or release any active export job.
  4. Retry only after changing the actual failure condition.
  5. If the browser lacks the requested codec, report that limitation without substituting a different format.

For human-facing Studio, storage, WebGL, and export diagnosis, continue with Troubleshooting and recovery. For deployment abuse controls, see API security.

On this page