! Fix error handling on XML preview

It totally did not work.

Signed-off-by: John Rayes <live627@gmail.com>
Merge pull request #2522 from live627/dev

! Fix error handling on XML preview