Commit b72fdd07 by Nepxion

增强异常处理

parent 201477bb
...@@ -58,6 +58,10 @@ public class ConfigInitializer { ...@@ -58,6 +58,10 @@ public class ConfigInitializer {
} else { } else {
inputStream = configLoader.getLocalInputStream(); 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 { ...@@ -53,9 +53,9 @@ public class ConfigParser extends Dom4JParser implements PluginConfigParser {
super.parse(text); super.parse(text);
} catch (NullPointerException e) { } catch (NullPointerException e) {
LOG.warn("No input stream is retrieved"); throw new PluginException("Input stream is null");
} catch (Exception e) { } catch (Exception e) {
LOG.error("Parse rule xml failed", e); throw new PluginException("Parse rule xml failed", e);
} finally { } finally {
if (inputStream != null) { if (inputStream != null) {
IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(inputStream);
......
...@@ -64,7 +64,13 @@ public class PluginSubscriber { ...@@ -64,7 +64,13 @@ public class PluginSubscriber {
} }
InputStream inputStream = ruleChangedEvent.getInputStream(); InputStream inputStream = ruleChangedEvent.getInputStream();
pluninConfigParser.parse(inputStream); try {
pluninConfigParser.parse(inputStream);
} catch (Exception e) {
LOG.error("Parse rule xml failed", e);
throw e;
}
refreshLoadBalancer(); 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