Commit 2e01c90b by Nepxion

修改异常抛出机制,当读取配置失败,不能影响服务注册发现功能

parent f224a3a6
......@@ -9,7 +9,6 @@ package com.nepxion.discovery.plugin.configcenter;
* @version 1.0
*/
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -21,7 +20,6 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.dom4j.Attribute;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -55,10 +53,10 @@ public class ConfigParser extends Dom4JParser {
String text = IOUtils.toString(inputStream, PluginConstant.ENCODING_UTF_8);
super.parse(text);
} catch (IOException e) {
throw new PluginException(e);
} catch (DocumentException e) {
throw new PluginException(e);
} catch (NullPointerException e) {
LOG.warn("No input stream is retrieved");
} catch (Exception e) {
LOG.error("Parse rule xml failed", e);
} finally {
if (inputStream != null) {
IOUtils.closeQuietly(inputStream);
......
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