Skip to content

Commit

Permalink
oracle-samples#264:Provide better exception when unable to resolve cl…
Browse files Browse the repository at this point in the history
…ass while deserializing rulebase
  • Loading branch information
ec027900 committed Jul 19, 2022
1 parent e86dcd4 commit 6ab490b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/clojure/clara/rules/durability/fressian.clj
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@
([^Reader rdr]
(read-record rdr nil))
([^Reader rdr add-fn]
(let [builder (-> (.readObject rdr) resolve deref)
(let [try-resolve #(if-let [clazz (resolve %)]
clazz
(throw (ex-info (str "Unable to resolve record symbol: '" % "'")
{:record-class %})))
builder (-> (.readObject rdr) try-resolve deref)
build-map (.readObject rdr)
m (read-meta rdr)]
(cond-> (builder build-map)
Expand Down

0 comments on commit 6ab490b

Please sign in to comment.