Catch error when loading xml.