improved exception handling for query tasks results