Skip to main content

MAX_ERROR_BODY_LEN

Constant MAX_ERROR_BODY_LEN 

Source
pub const MAX_ERROR_BODY_LEN: usize = 1024;
Expand description

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.