@mbtest/mountebank 2.9.3-beta.9600 → 2.9.3-beta.9674
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/models/xpath.js +3 -2
package/package.json
CHANGED
package/src/models/xpath.js
CHANGED
|
@@ -66,10 +66,10 @@ function nodeValue (node) {
|
|
|
66
66
|
* @returns {Object}
|
|
67
67
|
*/
|
|
68
68
|
function select (selector, ns, possibleXML, logger) {
|
|
69
|
-
const
|
|
69
|
+
const warn = logger?.warn || (() => {}),
|
|
70
|
+
DOMParser = xmlDom.DOMParser,
|
|
70
71
|
parser = new DOMParser({
|
|
71
72
|
onError: (level, message) => {
|
|
72
|
-
const warn = (logger || {}).warn || (() => {});
|
|
73
73
|
warn('%s (source: %s)', message, JSON.stringify(possibleXML));
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -80,6 +80,7 @@ function select (selector, ns, possibleXML, logger) {
|
|
|
80
80
|
}
|
|
81
81
|
catch (e) {
|
|
82
82
|
// Invalid XML, return undefined to indicate no match
|
|
83
|
+
warn('XML parsing error: %s (source: %s)', e.message, JSON.stringify(possibleXML));
|
|
83
84
|
return undefined;
|
|
84
85
|
}
|
|
85
86
|
|