Handle failures for query recursive