DIP33: A standard exception hierarchy

Lars T. Kyllingstad public at kyllingen.net
Tue Apr 2 13:15:25 PDT 2013


On Tuesday, 2 April 2013 at 16:36:36 UTC, Jacob Carlborg wrote:
> On 2013-04-02 17:56, Lars T. Kyllingstad wrote:
>
>> In my experience, most of the time, you don't even bother 
>> distinguishing
>> between the finer categories.  If you can't open a file, well, 
>> that's
>> that.  Tell the user why and ask them to try another file.  (I 
>> realise
>> that this is highly arguable, of course.)
>
> I would say that there's a big difference if a file exist or if 
> you don't have permission to access it. Think of the command 
> line, you can easily misspell a filename, or forget to use 
> "sudo".

This illustrates my point nicely!  What does the shell do in this 
case?  It treats both errors the same:  It prints an error 
message and returns to the command line.  It does not magically 
try to guess the filename, find a way to get you permission, etc.

Lars


More information about the Digitalmars-d mailing list