mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Use when on throw on error to avoid context loss
This commit is contained in:
@@ -83,18 +83,16 @@ namespace SabreTools.DatTools
|
||||
{
|
||||
DatFile.Create(datFormat, datFile, quotes)?.WriteToFile(outfile, ignoreblanks, throwOnError);
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception ex) when (!throwOnError)
|
||||
{
|
||||
logger.Error(ex, $"Datfile {outfile} could not be written out");
|
||||
if (throwOnError) throw ex;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception ex) when (!throwOnError)
|
||||
{
|
||||
logger.Error(ex);
|
||||
if (throwOnError) throw ex;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user