better error handling in wsgi