The new std.process is ready for review

Steven Schveighoffer schveiguy at yahoo.com
Sat Feb 23 16:21:26 PST 2013


On Sat, 23 Feb 2013 18:59:05 -0500, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:

> I don't know what the new std.process is doing (I haven't look at it  
> yet), but
> if it's throwing exceptions based on errno, it needs to at least put the  
> error
> code in the exception and maybe have specific exception types if it  
> would make
> sense to be catching exceptions from std.process based on what exactly  
> went
> wrong. Get the value of errno after catching the exception is just  
> asking for
> it, since who knows what code ran after the exception was originally  
> thrown.

It uses strerror to get the errno string representation, and uses that as  
the message.

I think it should also save the error code.

In a past life, I had a SystemException type (this was C++), and anything  
that died because of an errno error would throw a derivative of that,  
containing an errno copy.  If we already have a base ErrnoException, we  
ProcessException probably should derive from that.

-Steve


More information about the Digitalmars-d mailing list