validate-vat
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -49,5 +49,10 @@ // Generated by CoffeeScript 1.6.3 | ||
parseField = function(field) { | ||
var match, regex; | ||
var err, match, regex; | ||
regex = new RegExp("<" + field + ">\((\.|\\s)\*\)</" + field + ">", 'gm'); | ||
match = regex.exec(soapMessage); | ||
if (!match) { | ||
err = new Error("Failed to parseField " + field); | ||
err.soapMessage = soapMessage; | ||
throw err; | ||
} | ||
return match[1]; | ||
@@ -98,3 +103,8 @@ }; | ||
var data, err, _ref; | ||
data = parseSoapResponse(str); | ||
try { | ||
data = parseSoapResponse(str); | ||
} catch (_error) { | ||
err = _error; | ||
return callback(err); | ||
} | ||
if ((_ref = data.faultString) != null ? _ref.length : void 0) { | ||
@@ -101,0 +111,0 @@ err = new Error(getReadableErrorMsg(data.faultString)); |
{ | ||
"name": "validate-vat", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A Europe VAT number validation lib", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -58,2 +58,5 @@ # Validate European VAT number | ||
## Change Log | ||
####0.3.1 | ||
Wrap field parse in a try catch block when it can not parse a soap message. The soap message will be attached to the error object for furthur investigation. | ||
####0.3.0 - 05/Dec/2013 | ||
@@ -60,0 +63,0 @@ Instead of |
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
9748
111
90