Skip to main content

Function: formatAISDKErrorDiagnostics()

formatAISDKErrorDiagnostics(err): string

Defined in: packages/core/src/utils/format-error.ts:130

Format AI SDK error diagnostic fields as a parenthetical suffix. Returns an empty string if no diagnostic fields are present.

Walks the .cause chain so wrappers like NoOutputGeneratedError (which carry an APICallError as cause) still surface the underlying HTTP details.

Parameters​

err​

unknown

Any caught value. Non-Error values yield an empty string.

Returns​

string

A string like (status=502 url=https://… responseBody="…") or "".