addReason method

  1. @useResult
  2. @mustBeOverridden
  3. @override
UserException addReason(
  1. String? reason
)
override

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,
  );
}