Add minimal error handling
This commit is contained in:
parent
7beca7e0f6
commit
8f1701dabb
|
@ -4,7 +4,11 @@
|
||||||
(defn cwd [] (fs/cwd))
|
(defn cwd [] (fs/cwd))
|
||||||
|
|
||||||
(defn load-import
|
(defn load-import
|
||||||
([file] (-> file (fs/canonicalize) (fs/file) (slurp)))
|
([file]
|
||||||
|
(let [path (-> file (fs/canonicalize) (fs/file))]
|
||||||
|
(try (slurp path)
|
||||||
|
(catch java.io.FileNotFoundException _
|
||||||
|
(throw (ex-info (str "File " path " not found") {:path path ::error true}))))))
|
||||||
([file from]
|
([file from]
|
||||||
(load-import
|
(load-import
|
||||||
(fs/path
|
(fs/path
|
||||||
|
|
Loading…
Reference in New Issue
Block a user