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:
@@ -71,10 +71,9 @@ namespace SabreTools.DatFiles.Formats
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception ex) when (!throwOnError)
|
||||
{
|
||||
logger.Warning($"Exception found while parsing '{filename}': {ex}");
|
||||
if (throwOnError) throw ex;
|
||||
}
|
||||
|
||||
jtr.Close();
|
||||
@@ -404,10 +403,9 @@ namespace SabreTools.DatFiles.Formats
|
||||
jtw.Close();
|
||||
fs.Dispose();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception ex) when (!throwOnError)
|
||||
{
|
||||
logger.Error(ex);
|
||||
if (throwOnError) throw ex;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user