On Wed, Apr 25, 2012 at 2:33 PM, Terry Reedy <tjreedy@udel.edu> wrote:
On 4/25/2012 3:27 PM, Bryce Boe wrote:
2) an option to provide a structured error output in some common
easy-to-parse and extendable format that can be used to associate the
file, line number, error type/number in some post-processing error
handler. This feature would make the parsing of error messages more
deterministic, and would be of significant benefit if other
compilers/interpreters also provide the same functionality in the same
common format.

Exception instances have a .__traceback__ instance that is used to print the default traceback message. So it has or can generate much of what you request. I believe traceback objects are documented somewhere. Some apps wrap everything in

try: run_app
except Exception as e: custom_handle(e)

The sys module also has an excepthook (1) which can be overridden to customize the exception handling. Note that it does not function with the threading module, however.

(1) http://docs.python.org/library/sys.html#sys.excepthook
 


--
Terry Jan Reedy


_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas