Skip to main content

ErrorCollection

This class is a helper object that collects errors.

Methods


Error()

@classmethod
def Error() - > string

Returns a string representation of all collected errors. Call this method to get a human-readable summary of any issues encountered.

Returns

TypeDescription
stringA concatenated string of all error messages in the collection.

ErrorOrDefault()

@classmethod
def ErrorOrDefault() - > error

Returns the first error in the collection, or a default error if the collection is empty. Use this when you need to handle a single error case, but also want a fallback if no specific errors were collected.

Returns

TypeDescription
errorThe first error object in the collection, or a default error if the collection is empty.

Append()

@classmethod
def Append(
err: error
) - > bool

Appends a new error to the collection. This method allows you to add individual error objects to the collection for later retrieval or aggregation.

Parameters

NameTypeDescription
errerrorThe error object to be added to the collection.

Returns

TypeDescription
boolA boolean indicating whether the error was successfully appended to the collection.