Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit ab1df824 authored by Harald Martini's avatar Harald Martini
Browse files

Removed exception when overwriting existing report (added warning)

parent 56ea8b5d
No related branches found
No related tags found
No related merge requests found
......@@ -154,6 +154,10 @@ namespace TUGraz.VectoCore.OutputData.FileIO
public virtual void WriteReport(ReportType type, XDocument data)
{
var fileName = GetReportFilename(type);
if (File.Exists(fileName)) {
Log.Warn($"Overwriting file ({fileName})");
}
using (var writer = new FileStream(fileName, FileMode.Create)) {
using (var xmlWriter = new XmlTextWriter(writer, Encoding.UTF8)) {
xmlWriter.Formatting = Formatting.Indented;
......@@ -164,10 +168,6 @@ namespace TUGraz.VectoCore.OutputData.FileIO
}
var added = _writtenReports.TryAdd(type, fileName);
if (!added)
{
throw new VectoException("Report with type: {type} {fileName} already written from this reportwriter");
}
}
protected virtual string GetReportFilename(ReportType type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment