Wrap middleware call to `reverse` in exception handler to pass unit tests.