FjordWardenF
Denoβ€’3y agoβ€’
1 reply
FjordWarden

Deno hangs on error

Why does Deno hang when XML.parse throws an error?

let text = '<xml><xbrli:xbrl><hi>Hello</hi></xbrli:xbrl></xml>'
import * as XML from "https://deno.land/x/xml/mod.ts"

let parseXml = text => {
  try{
    return XML.parse(text)
  }catch(e){
    return null
  }
};

parseXml(text)
console.log('ok')
try{
  parseXml('fail')
}catch(e){
  console.log(e)
}
Was this page helpful?