Skip to main content
Nothing to catch. The SDK retries what is safe, and Laravel’s exception handler logs and renders the rest. Your code calls the method and moves on.
If the site refuses the quote, the user lands back on the form with the error under quote, exactly like Laravel’s own validation.

What Laravel does with each

Every failure carries its context to the log: the site, method, path, status, error name and the request id (never a query, body or header).

Reacting to one case

Catch only the class you want to react to. AttractException catches everything the SDK throws, config errors and refused arguments included.
For a missing document you don’t need a catch at all: findBlog() (and every find…()) returns null for a 404.

The classes

All in Fetchski\AttractCmsLaravel\Exceptions.

siteMessage()

The site’s own words: what it refused and how to fix it. Show it to people when it says more than errorName().

reason()

The client’s words when the site’s are missing. It names hosts and settings: for logs and developers, never for people.
A refused argument (an empty id, a blank required filter, an upload named without an extension) is a RequestNotSent too: status 0, errorName() notSent, the message naming the route (GET /api/v1/@apostrophecms/blog/{_id}), the engine’s own error as getPrevious(). Nothing was sent.

What is retried

A call that failed in a way that is safe to repeat is sent again, so your app never has to.

Rate limits

Any method. Waits Retry-After (1 s when unsaid); a wait over a minute is thrown for you to schedule.

Reads

No answer, or a 502, 503 or 504: after 0.5 s, then 1 s.

Writes

Only when they never reached the site. Never after a timeout or a 5xx.
A write that timed out may still have landed. Check before you send it again: a resend is a new write.
retries (2 by default) caps the extra attempts, and 0 turns them off. Each attempt is signed afresh.

Next: paging

One call for a whole list.