Skip to content

Instantly share code, notes, and snippets.

@vemv
Created January 5, 2020 05:22
Show Gist options
  • Save vemv/e9a7534a5bc7f277395add3e7c23a291 to your computer and use it in GitHub Desktop.
Save vemv/e9a7534a5bc7f277395add3e7c23a291 to your computer and use it in GitHub Desktop.
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