Currently the middleware execution is outside of the primary error handling coverage, which could lead to some weird situations.