Code to detect and handle CANDIDATE_NOT_FOUND errors from gateway