Pixir.Providers.ErrBody (pixir v0.1.9)

Copy Markdown View Source

Shared bounded error-body capture for provider transports.

Issue #268 item 1 keeps the cap in one place so OpenAI and Anthropic transports cannot drift in how much non-2xx response body they retain before classification.

Summary

Functions

Append bytes while retaining at most max_bytes/0.

Maximum number of error-body bytes retained before classification.

Whether the captured body is at the truncation marker threshold.

Functions

append(current, data)

@spec append(binary(), binary()) :: binary()

Append bytes while retaining at most max_bytes/0.

max_bytes()

@spec max_bytes() :: pos_integer()

Maximum number of error-body bytes retained before classification.

truncated?(body)

@spec truncated?(binary()) :: boolean()

Whether the captured body is at the truncation marker threshold.