Commit Graph

6 Commits

Author SHA1 Message Date
menachembadichi-blip 229d2d34fb Track CLI usage (#178)
AIAG-980
2026-08-04 16:47:19 +03:00
Niv Hertz 03302b4021 added x-cx-sdk-version header (#171) 2026-07-26 14:51:12 +03:00
Bar Chen be26fb0f28 AIAPP-1770 | udpate error msg (#126)
AIAP-1453

before: 

<img width="1017" height="69" alt="Screenshot 2026-06-02 at 14 34 41"
src="https://github.com/user-attachments/assets/37924452-8417-4fa4-b4ea-1942d75e4e7d"
/>

after:

<img width="961" height="76" alt="Screenshot 2026-06-02 at 14 34 46"
src="https://github.com/user-attachments/assets/e895192f-754c-44e3-8e62-78ba98c9b8e8"
/>
2026-06-02 14:53:24 +03:00
Bar Chen f2265a7e00 AGE-977 | update 403 error (#113)
AIAG-858
2026-05-26 14:12:48 +03:00
Yonatan Beker aa1b59889a fix: surface server error messages for 401, 403, and 429 responses (#94) 2026-05-12 15:26:14 +03:00
Liran Hason 45dc6c71d4 fix: distinguish 401, 403, and 429 HTTP errors in API client (#58)
AIAG-726
## Summary
- **401 Unauthorized** - keeps existing "Invalid or expired API key"
message
- **403 Forbidden** - now reads the response body and surfaces the
server's specific permission message (e.g., which scope is missing),
instead of showing the same auth error as 401
- **429 Too Many Requests** - new handler extracts the `Retry-After`
header and tells the user how long to wait
- **Refactored** `checked_text` into early-return + match - body and
detail parsed once, no duplicated logic

Previously both 401 and 403 were reported as "Invalid or expired API
key", masking permission issues as authentication failures.

## Tests
Added 7 integration tests in `tests/api_client/main.rs` covering every
`checked_text` branch:
- 401 unauthorized
- 403 with server message / without server message
- 429 with Retry-After header / without header
- 500 with JSON message / with raw body

---------

Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-05 08:58:56 +03:00