Skip to content

Commit

Permalink
Use ex-info map
Browse files Browse the repository at this point in the history
  • Loading branch information
oakes committed Aug 4, 2019
1 parent 5afd54c commit cb78fbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/iglu/glsl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
(defn ->function [signatures [name {:keys [args body]}]]
(if-let [{:keys [in out]} (get signatures name)]
(let [_ (when (not= (count in) (count args))
(throw (ex-info (str "The function " name " has args signature "
in " of a different length than its args definition "
args)
{})))
(throw (ex-info "Function has args signature of a different length than its args definition"
{:fn name
:signature in
:definition args})))
args-list (str/join ", "
(mapv (fn [type name]
(str type " " name))
Expand All @@ -128,7 +128,7 @@
(conj
(vec (butlast body-lines))
(str "return " (last body-lines)))))))
(throw (ex-info (str "Nothing found in :signatures for function " name) {}))))
(throw (ex-info "Nothing found in :signatures for function" {:fn name}))))

;; compiler fn

Expand Down
6 changes: 3 additions & 3 deletions src/iglu/parse.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
(some-> *fn-dependencies*
(swap! (fn [deps]
(when (contains? (deps x) *current-fn*)
(throw (ex-info (str "Cyclic dependency detected between functions "
*current-fn* " and " x)
{})))
(throw (ex-info "Cyclic dependency detected between functions"
{:first-fn *current-fn*
:second-fn x})))
(update deps *current-fn* #(conj (set %) x))))))
(or (symbol? x)
(number? x)
Expand Down

0 comments on commit cb78fbb

Please sign in to comment.