This project uses Break Versioning.
v2.1.0 (2025-04-29)This is a major rewrite of Truss that expands the library's scope, and modernises its implementation. There are breaking changes to the ex-data produced by the 4x assertion macros (have, have?, have!, have!?) in Truss and Encore.
This should be a non-breaking update for folks not using assertion ex-data, but please ping me if you run into any unexpected trouble. Apologies for the inconvenience! - Peter Taoussanis 🙏
set-error-fn! and with-error-fn have been deprecated. Please use *failed-assertion-handler* instead (see linked docstring for details).get-data and with-data have been deprecated. Please use *ctx* instead.By default, Truss throws an ex-info exception on assertion failures. The included ex-data has changed!
Old ex-data (Truss v1):
:pred ------ (Unchanged) Predicate form
:arg ------- (Unchanged) {:keys [form value type]}
:dt -------- `js/Error` or `java.util.Date`
:loc ------- {:keys [ns line column]}
:data ------ {:keys [arg dynamic]}
:env ------- {:keys [elidable? *assert*]}
:msg ------- String
:err ------- Error thrown during pred check
New ex-data (Truss v2):
:pred ------ (Unchanged) Predicate form
:arg ------- (Unchanged) {:keys [form value type]}
:inst ------ `js/Error` or `java.time.Instant` (note type change!)
:ns -------- Namespace string
:coords ---- ?[line column]
:data ------ Optional `:data` value (replaces :data/arg)
:truss/ctx - `truss/*ctx*` value (replaces :data/dynamic)
:msg ------- REMOVED (use `ex-message` instead)
:error ----- REMOVED (use `ex-cause` instead)
*failed-assertion-handler*.taoensso.truss.legacy-assertion-ex-data JVM property to true.Significant performance and expansion size improvements to the assertions API (have, have?, have!, have!?). Esp. useful for ClojureScript codebases that use many assertions.
Added new contextual exceptions API: ex-info, ex-info!, *ctx*, set-ctx!, with-ctx, with-ctx+.
Added new Error utils imported (moved) from Encore: error?, try*, catching, matching-error, throws, throws?, catching-rf, catching-xform, unexpected-arg!.
*failed-assertion-handler* [7de9a82] (v2.1.0)set-error-fn! should convert from v2 to v1 handler arg [d6bc7c5] (v2.1.0)set-error-fn! [e99fe6b] (v2.0.6)v1.12.0 (2024-09-07)📦 Available on Clojars, uses Break Versioning.
This is a non-breaking minor maintenance release that improves some docstrings and updates some internal code. Thank you!
v1.11.0 (2023-07-31)This is a maintenance + feature release, and should be a non-breaking upgrade.
v1.10.1 (2023-07-15)cljdoc.edn config (improve cljdoc output)v1.10.1 (2023-07-15)v1.10.1 (2023-07-15)This is a hotfix release, please upgrade if you're using v1.10.0.
v1.10.0 (2023-07-07)get-source from throwing for JAR resourcesv1.10.0 (2023-07-07)This is a minor feature release, and should be a non-breaking upgrade.
v1.9.0 (2023-03-15):column and :file to :loc data for invariant violationsv1.9.0 (2023-03-15)[com.taoensso/truss "1.9.0"]
This is a feature release. Should be non-breaking. See here for a tip re: general recommended steps when updating any Clojure/Script dependencies.
v1.8.0 (2022-12-13):form info to invariant violations:instance?, :satisfies? special predicate formsSee here for earlier releases.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |