Skip to main content

Module error

Module error 

Source

Enums§

CloudAiError

Constants§

MAX_ERROR_BODY_LEN
Cap on body length when surfacing a provider’s non-2xx response into CloudAiError::Status. The whole point is that this string flows back through tauri::command -> Result<_, String> to the renderer (and into logs along the way) - providers occasionally return multi-KB debug bodies, and an unbounded body inflates log lines and the renderer surface for no extra signal. The first ~1KB is enough to identify the failure class; anything longer is truncated with an explicit marker so the operator knows there was more.

Functions§

redact_error_body
Trim and length-cap a raw provider error body before stuffing it into CloudAiError::Status. Idempotent and safe on UTF-8: truncates at the last char boundary <= MAX_ERROR_BODY_LEN.