This is a reproduction/experiment repo for issue #1508 in sol2.
In my initial test I got an error message that does not contain exception information, but after more tests (in this repo), I saw even weirder behaviour.
This is the output for different versions of sol2:
enter main
MyException
Exception: Foobar
This is what it should be!
enter main
MyException
exit main
enter main
MyException
exit main