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);
}
});
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)
I think there's a mistake.
/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)