Handle exceptions in wsgi app better.