safeAddError method
Adds an error (with an optional stackTrace) to this controller if
it is not closed.
Returns true if the error was added successfully, or false if
the controller was closed.
Implementation
bool safeAddError(Object error, [StackTrace? stackTrace]) {
if (isClosed) return false;
try {
addError(error, stackTrace);
return true;
} catch (e) {
return false;
}
}