Commit 2e01c90b by Nepxion

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

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