diff options
author | scgilardi <scgilardi@gmail.com> | 2008-06-29 16:00:11 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2008-06-29 16:00:11 +0000 |
commit | 31e44f821b15c9759e74280ed1df2c8b1f797d0c (patch) | |
tree | c93816b245408d158326b2518eda2cb0a696c15c | |
parent | a2df976434057a815d2eed6cfdfacb328d3ea818 (diff) |
lib.clj: refine exception in load-resource
-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. |