http://d.puremagic.com/issues/show_bug.cgi?id=2545


s...@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s...@iname.com
            Summary|write(f)(ln) throws         |write(f)(ln) delays throwing
                   |StdioException("Bad file    |StdioException("Bad file
                   |descriptor") when no console|descriptor") when no console
                   |is available                |is available




------- Comment #1 from s...@iname.com  2008-12-29 10:21 -------
How can it never fail at all?  Or are you confusing "fail" with "throw an
exception"?

In any case, failing silently is completely the wrong approach.  If there is no
stdout to write to, it should throw an immediate exception.  That's what
exceptions are there for.

printf doesn't suppress errors.  It returns a value that indicates success or
failure.  This is because C doesn't have exception handling, and so C functions
have to improvise.  In D, OTOH, the only right thing to do is use exceptions to
indicate failure.
http://www.digitalmars.com/d/1.0/errors.html


-- 

Reply via email to