Skip to main content

Function: truncateErrorText()

function truncateErrorText(
value: string | null | undefined,
maxLength?: number
): string;

Defined in: utils/net/networkUtils.ts:76

Truncate response/error text for safe inclusion in thrown errors.

Parameters​

value​

string | null | undefined

Text to truncate.

maxLength?​

number = 500

Maximum number of characters to retain.

Returns​

string

Truncated text, or an empty string for non-string input.