I was under the impression that it is a built-in function - if a string is returned in 'check:' it sets opts.retry.