attempt to fix monadic translation of failwith

doesn't really work, because don't know how to deal with the assumptions
on the environment (that the exceptions exist) correctly