Skip to main content

2 docs tagged with "error-handling"

View All Tags

GraphQL Client

Query a GraphQL API with variables and store the result, with the error handling GraphQL actually needs: a failed query returns HTTP 200 with an errors array, so a status check alone silently stores nulls. Asserts on body.errors before writing, and keeps values in variables rather than interpolating into the query text.

Resilient HTTP

Call someone else's API and survive it. Declare which statuses count as success with expect_status, retry only what could plausibly succeed, send an Idempotency-Key so a retried POST cannot charge twice, and read a 404 or a 402 as data instead of an error. Self-contained: the examples call fixture routes on the same engine, so it deploys and curls with no external service, keys or database.