Detect circular middleware stacks and throw comprehensible exception.