|
20 | 20 |
|
21 | 21 | import org.audit4j.core.dto.AuditEvent;
|
22 | 22 | import org.audit4j.core.exception.ConfigurationException;
|
| 23 | +import org.audit4j.core.exception.InitializationException; |
23 | 24 | import org.audit4j.core.exception.TroubleshootException;
|
24 | 25 | import org.audit4j.core.util.Log;
|
25 | 26 |
|
@@ -79,22 +80,15 @@ public static void troubleshootConfiguration(ConfigurationException e) {
|
79 | 80 | if (e.getId().equals("CONF_001")) {
|
80 | 81 | Log.warn("Initial confguration file not found. Creating a new configuration file - ",
|
81 | 82 | CoreConstants.CONFIG_FILE_NAME);
|
82 |
| - ConfigUtil.generateConfigFromObject(); |
| 83 | + try { |
| 84 | + ConfigUtil.generateConfigFromObject(); |
| 85 | + } catch (ConfigurationException e1) { |
| 86 | + throw new InitializationException("Initialization Failed.! Unable to create new configuration file."); |
| 87 | + } |
83 | 88 | } else if (e.getId().equals("CONF_002")) {
|
84 | 89 | Log.error("Configuration file currupted or invalid configuration. ",
|
85 | 90 | ErrorGuide.getGuide(ErrorGuide.CONFIG_ERROR));
|
86 | 91 | throw new TroubleshootException("Configuration error", e);
|
87 | 92 | }
|
88 | 93 | }
|
89 |
| - |
90 |
| - /** |
91 |
| - * Checks if is windows. |
92 |
| - * |
93 |
| - * @return true, if is windows |
94 |
| - */ |
95 |
| - public static boolean isWindows() { |
96 |
| - String os = System.getProperty("os.name"); |
97 |
| - return os.startsWith("Windows"); |
98 |
| - } |
99 |
| - |
100 | 94 | }
|
0 commit comments