Slightly cleaaned up version of this pcase/minibuffer hack, using Emacs Lisp catch together with Java exception