Improve exception factory with ErrorException s