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
| Type | Description |
|---|---|
string | A 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
| Type | Description |
|---|---|
error | The 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
| Name | Type | Description |
|---|---|---|
| err | error | The error object to be added to the collection. |
Returns
| Type | Description |
|---|---|
bool | A boolean indicating whether the error was successfully appended to the collection. |