diff options
| author | Aizistral | 2023-06-26 16:40:31 +0200 |
|---|---|---|
| committer | Aizistral | 2023-06-26 16:40:31 +0200 |
| commit | a802f9f758f3664c60136282c2a8265ebcf1a00a (patch) | |
| tree | eb74d2f72a3ea5a982dbca685c04b895979ec14a /src | |
| parent | d03690fed7871764dc7c36f49af39e0ffe801710 (diff) | |
Improve config IO error handling
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/com/aizistral/nochatreports/common/config/JSONConfig.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/common/config/JSONConfig.java b/src/main/java/com/aizistral/nochatreports/common/config/JSONConfig.java index 9c7c2e9..f8fe3b4 100644 --- a/src/main/java/com/aizistral/nochatreports/common/config/JSONConfig.java +++ b/src/main/java/com/aizistral/nochatreports/common/config/JSONConfig.java @@ -62,8 +62,8 @@ public abstract class JSONConfig { NCRCore.LOGGER.fatal("Could not read config file: {}", file); NCRCore.LOGGER.fatal("This likely indicates the file is corrupted. " + "You can try deleting it to fix this problem. Full stacktrace below:"); - ex.printStackTrace(); - return null; + NCRCore.LOGGER.catching(ex); + throw new RuntimeException("Could not read config file: " + file, ex); } } @@ -77,7 +77,9 @@ public abstract class JSONConfig { } } catch (Exception ex) { NCRCore.LOGGER.fatal("Could not write config file: {}", file); - throw new RuntimeException(ex); + NCRCore.LOGGER.fatal("Full stacktrace below:"); + NCRCore.LOGGER.catching(ex); + throw new RuntimeException("Could not write config file: " + file,ex); } } |
