addReason method
Returns a new UserException, copied from the current one, but adding the given reason
.
Note the added reason
won't replace the original reason, but will be added to it.
Implementation
@useResult
@mustBeOverridden
@override
UserException addReason(String? reason) {
UserException exception = super.addReason(reason);
return AdvancedUserException(
exception.message,
reason: exception.reason,
code: exception.code,
onOk: onOk,
onCancel: onCancel,
hardCause: hardCause,
props: props,
errorText: errorText,
ifOpenDialog: ifOpenDialog,
);
}