How to generate an Event when an Error or Exception occurs

We have a requirement to generate an Event when an error or exception occurs.Can someone please tell me how to do that in webMethods 9.5 ?