www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Uncaught errors should go to stderr

reply Stewart Gordon <smjg_1998 yahoo.com> writes:
errors.html
"If no catch handlers are there for the errors, then the program 
gracefully exits through the default error handler with an appropriate 
message."

However, the errors are written to stdout.  This means that if the 
output is redirected, the error will not appear to the user there and 
then.  Someone would run a program, redirect its output, and think that 
the program has run successfully since no error message has appeared. 
Only when he/she/someone else reads the output file, which may be ages 
later, is it discovered that the program didn't finish, but has written 
a message like "Error: Access Violation" to the file.  To me, this 
doesn't constitute gracefully exiting in any sense.

The default error handler should write the error message to stderr, not 
stdout.  That's what stderr's there for, isn't it?

Stewart.
Oct 04 2004
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
A fix was written for this before, but for some reason Walter seems not 
ready to put in the patches that the patch for this depends on.

Therefore, I hereby contribute a patch to fix only this issue while 
leaving the dubious issues alone.

Now, as far as I'm concerned there's no reason not to land this in 
0.128.  The sooner it gets in, the more time will be potentially saved 
and the better for the D public image.

Stewart.

-- 
My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.
Jun 20 2005