I see two problems here:
First "str(exception)" is not safe when the exception message contains non-ascii characters. One common example are psycopg2/PostgreSQL exceptions. Trac has some code to convert an exception message to a string which does not throw errors (but might loose some unconvertable characters).

The second thing is that my application has a custom exception handler outside the dispatcher. I need some way to deal with the actual exception (especially to retrieve the traceback). Not sure what the best API is for that. Also catching this exception might interfere with the different debugging middlewares, right?