Refactor slightly to avoid reentrancy in the case of an unhandled error in a callback function.

An error in the callback function is caught by the catch() statement in repo() and then the same callback is called once more from the catch() statement. This leads to very confusing output from the callback and also hides potentially useful crash information when the callback is initially called and errors out.