aboutsummaryrefslogtreecommitdiff
path: root/lib.clj
diff options
context:
space:
mode:
Diffstat (limited to 'lib.clj')
-rw-r--r--lib.clj9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib.clj b/lib.clj
index 172d8c75..13b547b5 100644
--- a/lib.clj
+++ b/lib.clj
@@ -265,10 +265,11 @@
(let [url (cond ; coerce argument into URL
(instance? URL loc) loc
(instance? URI loc) (.toURL loc)
- (string? loc) (URL. loc)
- :else (throw (Exception.
- (str "Cannot coerce " (class loc)
- " to java.net.URL."))))]
+ (string? loc) (URL. loc))]
+ (when-not url
+ (throw
+ (Exception.
+ (str "Cannot coerce " (class loc) " to java.net.URL"))))
(with-open reader
(BufferedReader.
(InputStreamReader.