Missing MiddlewareError import causing traceback

Ticket:	#4128