Closed braedon closed 3 years ago
I do not fully understand if this is the best solution, but I'll trust you on this and merge. It only affects the error path, so it should not affect normal working applications. And it has tests \o/ Thanks!
Thanks @defnull, Happy New Year!
Recommended by pep-3333 to enable middleware to provide exception handling services, e.g. custom exception logging.
See https://www.python.org/dev/peps/pep-3333/#error-handling
Note that the exc_info is temporarily stored in the environ to pass it up from _handler() to wsgi(), where start_response() is called. There may be a better way to do this, e.g. storing it in the response object.
Supersedes https://github.com/bottlepy/bottle/pull/1097, and includes the tests from @BubaVV in https://github.com/bottlepy/bottle/pull/1103