nmarus / node-ews

A simple JSON wrapper for the Exchange Web Services (EWS) SOAP API.
MIT License
116 stars 52 forks source link

I think there's a mistake #21

Closed myx75 closed 8 years ago

myx75 commented 8 years ago

I think there's a mistake.

ntlm[method](options, function(err, res) {
  if(err) {
    callback(**error**);
  } else {
    var body = res.body;
    if (typeof body === "string") {
      // Remove any extra characters that appear before or after the SOAP
      // envelope.
      var match = body.match(/(?:<\?[^?]*\?>[\s]*)?<([^:]*):Envelope([\S\s]*)<\/\1:Envelope>/i);
      if (match) {
        body = match[0];
      }
    }
    callback(null, res, body);
  }
});

/xxx/node_modules/node-ews/lib/http.js:36 callback(error);

ReferenceError: error is not defined at /xxx/node_modules/node-ews/lib/http.js:36:18 at finalCallback (/xxx/node_modules/node-ews/node_modules/httpntlm/node_modules/httpreq/lib/httpreq.js:133:4) at ClientRequest. (/xxx/node_modules/node-ews/node_modules/httpntlm/node_modules/httpreq/lib/httpreq.js:436:3) at emitOne (events.js:77:13) at ClientRequest.emit (events.js:169:7) at Socket.socketOnEnd (_http_client.js:288:9) at emitNone (events.js:72:20) at Socket.emit (events.js:166:7) at endReadableNT (_stream_readable.js:905:12) at doNTCallback2 (node.js:441:9)

nmarus commented 8 years ago

Thanks. I just fixed the typo in 2.1.3.