Skip to content

Commit ef70769

Browse files
committed
better error around config.edn
<!-- ps-id: 57ca589f-e08b-4542-8b0d-55d14e954ff1 -->
1 parent 0896e3e commit ef70769

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

libs/kit-generator/src/kit/generator/modules.clj

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,22 @@
3636
{}
3737
modules))
3838

39-
(defn- render-module-config [ctx module-path]
40-
(some->> (io/concat-path module-path "config.edn")
39+
(defn- render-module-config [ctx path]
40+
(some->> path
4141
(slurp)
4242
(renderer/render-template ctx)))
4343

44-
(defn- read-module-config [ctx path]
45-
(-> (render-module-config ctx path)
46-
(io/str->edn)))
44+
(defn- read-module-config [ctx module-path]
45+
(let [path (io/concat-path module-path "config.edn")]
46+
(try
47+
(-> (render-module-config ctx path)
48+
(io/str->edn))
49+
(catch Exception e
50+
(throw (ex-info (str "Failed to read and render module config at " path)
51+
{:error ::read-module-config
52+
:path path
53+
:ctx ctx}
54+
e))))))
4755

4856
(defn- module-info
4957
[module-key module-path module-doc module-config]

0 commit comments

Comments
 (0)