
    _resultsSubject.add(result);
  } catch (error) {
    if (throwExceptions) {
      _resultsSubject.addError(error);
      _commandResultsSubject.addError(error);
      _isExecutingSubject.add(
          false); &#47;&#47; Has to be done because in this case no command result is queued
      return;
    }

    _commandResultsSubject.add(CommandResult&lt;TResult&gt;(
        _emitLastResult ? lastResult : null, error, false));
  } finally {
    _isRunning = false;
    _canExecute = !_executionLocked;
    