Skip to content

Commit

Permalink
catch xml ParseError (#10516)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s authored Sep 7, 2024
1 parent 3e8dafb commit cf656d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion services/dynamic/dynamic-xml.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ export default class DynamicXml extends BaseService {
const pathIsAttr = (
pathExpression.split('/').slice(-1)[0] || ''
).startsWith('@')
const parsed = new DOMParser().parseFromString(buffer, 'text/xml')

let parsed
try {
parsed = new DOMParser().parseFromString(buffer, 'text/xml')
} catch (e) {
throw new InvalidResponse({ prettyMessage: e.message })
}

let values
try {
Expand Down

0 comments on commit cf656d3

Please sign in to comment.