Improve exception message processing