Skip to content

Instantly share code, notes, and snippets.

@vemv
Created Jan 5, 2020
Embed
What would you like to do?
diff --git a/src/nedap/utils/spec/impl/check.cljc b/src/nedap/utils/spec/impl/check.cljc
index dc270bd..535b095 100644
--- a/src/nedap/utils/spec/impl/check.cljc
+++ b/src/nedap/utils/spec/impl/check.cljc
@@ -35,7 +35,8 @@
(pr-str spec-quoted#)
"\n\n-------------------------"))
true println)
- (throw (ex-info "Validation failed" {:spec spec-quoted#
- :faulty-value x-quoted#
- :explanation (~explain spec# x#)})))))
+ (throw (cond-> (ex-info "Validation failed" {:spec spec-quoted#
+ :faulty-value x-quoted#
+ :explanation (~explain spec# x#)})
+ ~cljs (~(if cljs 'js/Error. `Exception.)))))))
true))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment