/// <summary> /// Dispose output, such as the writer writing to a file /// </summary> internal void DisposeOutput() { //This method gets called from EtlOrchestrator in case of cancellation if (_outputToWriter) { _outputFileWriter?.Dispose(); //note that writer can be null if ConfigRejected } else //output to OutputConsumer (orOutputConsumerAsync) function { try { _config.OutputDisposer(_globalCache); } catch (Exception ex) { //errors during disposal are logged, but otherwise ignored _config.Logger.LogError("Error occurred during output disposal (OutputDisposer function).", ex); } } }