Skip to content

@graphty/graphty-element / index / ErrorAggregator

Class: ErrorAggregator ​

Defined in: graphty-element/src/data/ErrorAggregator.ts:36

Aggregates and groups errors during data loading to provide user-friendly error messages

Constructors ​

Constructor ​

new ErrorAggregator(maxErrors?): ErrorAggregator

Defined in: graphty-element/src/data/ErrorAggregator.ts:46

Creates a new ErrorAggregator instance.

Parameters ​

maxErrors? ​

number = 100

Maximum number of errors to collect before stopping

Returns ​

ErrorAggregator

Methods ​

addError() ​

addError(error): boolean

Defined in: graphty-element/src/data/ErrorAggregator.ts:55

Add an error to the aggregator

Parameters ​

error ​

DataLoadingError

The error to add

Returns ​

boolean

true if error was added, false if error limit reached


clear() ​

clear(): void

Defined in: graphty-element/src/data/ErrorAggregator.ts:210

Clear all errors

Returns ​

void


getDetailedReport() ​

getDetailedReport(): string

Defined in: graphty-element/src/data/ErrorAggregator.ts:174

Get a detailed error report with all error messages

Returns ​

string

Comprehensive report with categorized errors


getErrorCount() ​

getErrorCount(): number

Defined in: graphty-element/src/data/ErrorAggregator.ts:93

Get the total number of errors

Returns ​

number

The count of accumulated errors


getErrorLimit() ​

getErrorLimit(): number

Defined in: graphty-element/src/data/ErrorAggregator.ts:101

Get the number of errors this aggregator collects before it stops

Returns ​

number

The error limit


getErrors() ​

getErrors(): DataLoadingError[]

Defined in: graphty-element/src/data/ErrorAggregator.ts:117

Get all errors

Returns ​

DataLoadingError[]

Array of all accumulated errors


getSummary() ​

getSummary(): ErrorSummary

Defined in: graphty-element/src/data/ErrorAggregator.ts:125

Get a summary of all errors

Returns ​

ErrorSummary

Error summary with categorization and suggestions


getUserFriendlyMessage() ​

getUserFriendlyMessage(): string

Defined in: graphty-element/src/data/ErrorAggregator.ts:159

Get a user-friendly error message

Returns ​

string

Formatted error message with suggestions


hasReachedLimit() ​

hasReachedLimit(): boolean

Defined in: graphty-element/src/data/ErrorAggregator.ts:109

Check if error limit has been reached

Returns ​

boolean

True if the maximum error count has been reached