mergeError method
Merges this error with another LogError, prioritizing the most severe error.
newErr: The new error to merge with this one.
If newErr indicates success, no changes are made. Otherwise, the lowest (most
negative) error code is retained, and the message is appended with the new
message, separated by a slash.
Implementation
void mergeError(LogError newErr) {
if (newErr.isSuccess) {
return;
}
error = (error < newErr.error) ? error : newErr.error;
message = '$message / ${newErr.message}';
}