# Libxml: handling parse errors

**URL:** <https://www.ruby-forum.com/t/libxml-handling-parse-errors/55158>\
**Category:** Ruby\
**Created:** [March 17, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/libxml-handling-parse-errors/55158 "2006-03-17T14:22:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Mage](https://www.ruby-forum.com/u/Mage)\
**Post date:** [March 17, 2006, 2:22pm UTC](https://www.ruby-forum.com/t/libxml-handling-parse-errors/55158/1 "2006-03-17T14:22:47Z")

</div>

Hello,

I found the libxml API very nice, so I started using it.

When I try to open a non-well-formed xml, two things happen:

- errors are displayed on screen (stderr)
- exception raises

Well, I would like to catch the error messages instead of displaying  
them. After reading the documentation, all my ideas faded away (except  
hacking stderr which is not I want to do).

Could you help please?

```
   Mage
```

---

<div class="post-metadata">

**Author:** ![Mage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/6f9a4e/32.png) [@Mage](https://www.ruby-forum.com/u/Mage)\
**Post date:** [March 17, 2006, 3:03pm UTC](https://www.ruby-forum.com/t/libxml-handling-parse-errors/55158/2 "2006-03-17T15:03:34Z")

</div>

On Fri, 2006-03-17 at 22:20 +0900, Mage wrote:

> 

We have a (contributed) patch that addresses this (allows an error proc  
to be used) that will certainly make the next libxml-ruby release. I  
won’t post it here since it’s yet to be merged with the new code.
