Oh, the custom message is a nice idea. I should do that on kse.flow, which uses boundary.break heavily for exactly this sort of thing (kse3/flow/src/Flow.scala at main · Ichoran/kse3 · GitHub for example). Funnily enough, I used that to give better error messages on math on wrong types, and didn’t think to use it here.
I suggest that rather than .value, which is almost always a safe accessor for a value, that you use .? to match Rust? Or perhaps .ask?
I’ve coded with this paradigm a lot, and having something where the control flow leaps out at you is a good idea.
Note that you also probably want to replace Try, because Try eats control flow, so it isn’t scalable. (I solve this by having safe blocks which let control flow through and threadsafe blocks which catch it.)