req.promise = function()

in src/aws/SDK2.ts [181:196]


      req.promise = function () {
        let ret = _promise.apply(this, arguments);

        if (!callback) {
          // we check just in case a .send() was done, which shouldn't be done but users...
          callback = true;
          ret = wrapPromise(
            span,
            ret,
            // convert from Promise.then(res) success args to aws-sdk2 callback(err, res) success args
            beforeCB ? { beforeCB: (span: Span, res: any) => beforeCB(span, null, res) } : null,
          );
        }

        return ret;
      };