Skip to main content

truncateErrorText

FitFileViewer - API Documentation v30.0.1


FitFileViewer - API Documentation / utils/net/networkUtils / truncateErrorText

Function: truncateErrorText()

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.