Fix tests by removing uneeded error traces
authorNiki Roo <niki@nikiroo.be>
Sun, 25 Mar 2018 21:50:02 +0000 (23:50 +0200)
committerNiki Roo <niki@nikiroo.be>
Sun, 25 Mar 2018 21:50:02 +0000 (23:50 +0200)
src/be/nikiroo/fanfix/supported/Html.java
src/be/nikiroo/fanfix/supported/InfoText.java

index 1e960bf84978bf1125aececd6d59a47eff38f9f9..c7db5d83ce3c0f16d1525dbb591f9453571cd420 100644 (file)
@@ -21,8 +21,15 @@ class Html extends InfoText {
 
        @Override
        protected boolean supports(URL url) {
-               File txt = getTxt(url);
-               return txt != null && txt.exists();
+               try {
+                       File txt = getTxt(url);
+                       if (txt != null) {
+                               return super.supports(txt.toURI().toURL());
+                       }
+               } catch (MalformedURLException e) {
+               }
+
+               return false;
        }
 
        @Override
@@ -36,9 +43,6 @@ class Html extends InfoText {
                                                new IOException("Cannot convert the right URL for "
                                                                + source, e));
                        }
-               } else {
-                       Instance.getTraceHandler().error(
-                                       new IOException("Cannot find the right URL for " + source));
                }
 
                return source;
index 5488ab0648f1e42c6ba476c921b9be9be6bf41d6..786e771a40c2f8c6cee016c7f0aeb14c2bd365f8 100644 (file)
@@ -54,7 +54,6 @@ class InfoText extends Text {
                        }
 
                        return meta;
-
                } catch (URISyntaxException e) {
                        throw new IOException("Cannot parse URL to file: " + source, e);
                }