Added error events

Let me know if you are accepting pull requests. I can also add some examples