Skip to content

docs: document error handling in the README - #64

Merged
tharropoulos merged 1 commit into
typesense:masterfrom
OLIOEX:docs-error-handling
Nov 11, 2026
Merged

tharropoulos merged 1 commit into
typesense:masterfrom
OLIOEX:docs-error-handling

Conversation

@erimicel

Copy link
Copy Markdown
Contributor

Adds an "Error handling" section to the README. This is the README part of #60, split out on its own.

It also corrects the example from #60. Errors are built with new(response: response), so e.data is a Hash and the Faraday response is at e.data[:response]. The #60 example called e.data.status, which raises NoMethodError.

Changes

  • How to read the message, HTTP status and body from a raised Typesense::Error.
  • Which exception class each status code maps to.
  • Network failures that exhaust retries are re-raised as the original Faraday/Errno exception, not as a Typesense::Error.

Verification

Ran the README example against master with a stubbed 404 response: e.message is "Not Found", e.data[:response].status is 404, and e.data[:response].body is the raw JSON body.

PR Checklist

Explain how to read the message, HTTP status and body from a raised Typesense::Error, which class each status code maps to, and that network errors are re-raised as-is once retries run out.
@erimicel
erimicel force-pushed the docs-error-handling branch from 535884c to a26a923 Compare November 10, 2026 20:19
@tharropoulos
tharropoulos merged commit 2a05c0a into typesense:master Nov 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants