Improve exception trace break logic