function invokeGuardedCallback(name, func, a, b) {
  try {
    return func(a, b);
  } catch (x) {
    if (caughtError === null) {
      caughtError = x;
    }
    return undefined;
  }
}
Call a function while guarding against errors that happens within it.

@param {?String} name of the guard to use for logging or debugging
@param {Function} func The function to invoke
@param {*} a First argument
@param {*} b Second argument