Commit b72fdd07 by Nepxion

增强异常处理

parent 201477bb
......@@ -58,6 +58,10 @@ public class ConfigInitializer {
} else {
inputStream = configLoader.getLocalInputStream();
}
configParser.parse(inputStream);
try {
configParser.parse(inputStream);
} catch (Exception e) {
LOG.error("Parse rule xml failed", e);
}
}
}
\ No newline at end of file
......@@ -53,9 +53,9 @@ public class ConfigParser extends Dom4JParser implements PluginConfigParser {
super.parse(text);
} catch (NullPointerException e) {
LOG.warn("No input stream is retrieved");
throw new PluginException("Input stream is null");
} catch (Exception e) {
LOG.error("Parse rule xml failed", e);
throw new PluginException("Parse rule xml failed", e);
} finally {
if (inputStream != null) {
IOUtils.closeQuietly(inputStream);
......
......@@ -64,7 +64,13 @@ public class PluginSubscriber {
}
InputStream inputStream = ruleChangedEvent.getInputStream();
pluninConfigParser.parse(inputStream);
try {
pluninConfigParser.parse(inputStream);
} catch (Exception e) {
LOG.error("Parse rule xml failed", e);
throw e;
}
refreshLoadBalancer();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment