[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSavePanel complains about .hidden

From: Adam Fedor
Subject: Re: NSSavePanel complains about .hidden
Date: Sun, 06 Oct 2002 19:30:41 -0600
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0.0) Gecko/20020610

Nicola Pero wrote:
Ok - it looks silly to discuss too much about this anyway (with all the
pending stuff) but I can't avoid another one on this :-)

I don't understand why you are assuming that +stringWithContentsOfFile
returning nil is an error.  The caller will assess that.  In the case of
NSSavePanel, for example, it's a perfectly valid condition.

<pedantic>Technically a nil return here indicates a failure ... an error. I'ts up to the caller to decide how to deal with that, not to decide whether it's a failure or not.</pedantic>

<pedantic>An 'error', for the programmer using the base library, is when
the base library generates an exception. Anything else is not an error. A nil return here indicates that the file doesn't exist, is not readable
or can't be read.  This is considered a valid result, otherwise the API
would have required an exception - with the name and reason of the error -
to be raised.</pedantic>

That's not true. init methods are not supposed to generate an exception, they are supposed to log an error, release the object and return nil (at least the way we currently specify it, see http://www.gnustep.org/resources/documentation/coding-standards_5.html#SEC5 - if we want to change that, it's a different matter).

Adam Fedor, Digital Optics Corp.      | I'm glad I hate spinach, because
http://www.doc.com                    | if I didn't, I'd eat it, and you
                                      | know how I hate the stuff.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]