Improved error handling in Exception helper