Fork me on GitHub
Daniel Gerson15:10:15

In bb tasks is there a way to throw a presentation error, i.e. you want to fail with just a line stating "Criterion not satisfied, please do x" , rather than the whole error stack? I'm guessing not and I'll need a special wrapper bit of code. Just wondering if the use case is common?


You can do (throw (ex-info "Criterion not satisfied" {:babashka/exit 1})) I think

🤯 3
👍 2

or just call (System/exit 1) yourself

Daniel Gerson04:10:09

{:babashka/exit 1}is preferable as System/exitmakes for an unpleasant nrepl experience. For anyone finding this in the future.

Daniel Gerson15:10:25

Awesome thanks, works great!