diff options
Diffstat (limited to 'lib.clj')
-rw-r--r-- | lib.clj | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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. |