Fork me on GitHub
#babashka
<
2022-10-21
>
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?

borkdude15:10:05

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

🤯 3
👍 2
borkdude15:10:19

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.

1
Daniel Gerson15:10:25

Awesome thanks, works great!