_assertFunction(fn, res) {
    let err;
    try {
      err = fn(res);
    } catch (e) {
      err = e;
    }
    if (err instanceof Error) return err;
  }
Performs an assertion by calling a function and return an Error upon failure.

@param {Function} fn
@param {Response} res
@return {?Error}
@api private