# Error recovery

## Sub-features

Specific EN/IT messages, non-retryable errors without Retry, retryable failures with Retry, and Use another photo retaining the saved image until replacement is confirmed.

## How to get to it (user POV)

Open the widget, confirm a photo, and receive a failed generation response.

## Driving it with Playwright

The helper fulfills the API request with photo_body_hidden, verifies Retry is absent, and clicks Use another photo. It reads browser storage to prove the old image survives. After an actual file pick it returns quality_failed, verifies Retry, clicks it and observes exactly one additional request and a result. Unit tests additionally cover both refusal codes, bad_image, legacy Brain responses, non-JSON responses and unknown error copy.

## Gotchas

Shopify receives detail.code. Woo receives top-level code or an allowlisted error field. Existing refusal copy differs by platform. Backend explanations must never become visible messages or analytics values.
