How to capture exception information in a hook for further investigation?

Previous message deleted due to SPAM reasons.