Consolidate handling of sleeping on errors and sleep on query errors always