Support exceptions in trainer message handlers.
This, for one, makes Ctrl-C work.