Improve error formatting