>> Displaying the class name of the exception object should probably
>> only be done by a quick-and-dirty application.  A real application
>> should handle this more intelligently.

Artur> I agree, but I'm afraid it is a bit too platform dependent.

What I'm saying is that the underlying implementation of the IO
primitives should set the message in the exception sensibly.  If it
can't, well, then that is just a bug in that port.

So, for instance, in libgcj we use the strerror() output to construct
the message.  If there is a file name, we include that too, eg:

  if (fd == -1)
    {
      char msg[MAXPATHLEN + 200];
      sprintf (msg, "%s: %s", buf, strerror (errno));
      JvThrow (new FileNotFoundException (JvNewStringLatin1 (msg)));
    }

Artur> Anyway, I think that duplicating type of exception in message
Artur> string is a way to go

I don't like it, because it makes the exception message less useful.
If the application wants the class name, it knows where to find it.

Tom

Reply via email to