@seydx/tr064
Advanced tools
Comparing version 0.4.1-7 to 0.4.1-8
{ | ||
"name": "@seydx/tr064", | ||
"version": "0.4.1-7", | ||
"version": "0.4.1-8", | ||
"author": "Nicolai Schmid <hey@schmid.uno>", | ||
@@ -5,0 +5,0 @@ "description": "TR-064 - UPnP/IGD for node.js", |
@@ -346,31 +346,41 @@ var parseString = require('xml2js').parseString; | ||
} else { | ||
parseString(response.body,{explicitArray: false,}, function (err, result) { | ||
if(!err){ | ||
let env = result['s:Envelope']; | ||
if(env['s:Body']){ | ||
let newBody = env['s:Body']; | ||
if(newBody['s:Fault']){ | ||
let fault = newBody['s:Fault']; | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
tr064: fault ? fault.detail.UPnPError.errorDescription : 'No message', | ||
tr064code: fault ? fault.detail.UPnPError.errorCode : 'No code', | ||
fault: fault ? fault.faultstring : 'No message', | ||
faultcode: fault ? fault.faultcode : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
} | ||
} | ||
} else { | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
} | ||
}); | ||
callback(error, null); | ||
if(response){ | ||
parseString(response.body,{explicitArray: false,}, function (err, result) { | ||
if(!err){ | ||
let env = result['s:Envelope']; | ||
if(env['s:Body']){ | ||
let newBody = env['s:Body']; | ||
if(newBody['s:Fault']){ | ||
let fault = newBody['s:Fault']; | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
tr064: fault ? fault.detail.UPnPError.errorDescription : 'No message', | ||
tr064code: fault ? fault.detail.UPnPError.errorCode : 'No code', | ||
fault: fault ? fault.faultstring : 'No message', | ||
faultcode: fault ? fault.faultcode : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
} | ||
} | ||
} else { | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
} | ||
}); | ||
callback(error, null); | ||
} else { | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
callback(error, null); | ||
} | ||
} | ||
@@ -377,0 +387,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
222775
722