[openbeos] Re: B_NOT_IMPLEMENTED

  • From: Tyler Dauwalder <tyler@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sun, 02 Nov 2003 21:29:41 -0800

On 2003-11-02 at 13:46:17 [-0800], you wrote:
> Tyler Dauwalder <tyler@xxxxxxxxxxxxx> wrote:
> > > I am not sure if B_NOT_IMPLEMENTED is a good error message, as it
> > > would
> > > only be useful for beta APIs
> > Well, I'm not really expecting it to be returned very often in
> > production
> > code, but in the course of development, it's oftentimes been useful
> > to flag
> > that all or part of a function is unimplemented, and having a "return
> > B_NOT_IMPLEMENTED;" is a nice and obvious, plus syntactically and
> > semantically correct way of doing that.
> 
> It's a kind of deficiency that shouldn't be honored with its own error
> code IMO :)

Well, the intent is simply that it serves as a useful flag that the error 
being returned is not due to user error or something else going wrong, but 
simply lack of implementation. We've used it before in the storage kit 
stuff, and even though it was #defined to be the same as B_ERROR, I thought 
it did a really good job of signalling those parts that were not yet 
completed, particularly when the code I was looking at did not belong to 
me. So I'm intending it more as a development aid than a standard error 
code, but it needs somewhere to live unless we want to keep #defining it in 
each .cpp file where we want to use it, and Errors.h makes sense.

> I'd like a UNIMPLEMENTED() macro (as Marco did in the Media Kit) and
> returning something along the lines of B_ERROR better, 

Well, I gave it a try to see if I liked it, but it doesn't really do it for 
me. :-)

> but OTOH an
> error code more shouldn't hurt as well.

Exactly. So unless you or someone else really strongly objects, I'd just as 
soon add it. :-)
 
> > > - maybe EOPNOTSUPP or ENOTSUP is a better
> > > one in this case.
> > I would tend to shy away from using Posix errors. We do have
> > B_UNSUPPORTED,
> > but it doesn't really fit the situation either.
> 
> Well, right; I think we should have a B_ error code for every POSIX
> error code (we need).

Agreed. :-)

-Tyler

Other related posts: