[Gtk-sharp-list] Gdk.Color, further comments.
04 Mar 2003 13:36:41 +0000
On Mon, 2003-03-03 at 18:33, Charles Iliya Krempeaux wrote:
> OK, now what about the implementation of the System.IO.Stream class,
> using GnomeVFS. For example, consider the implementation of the
> "Close" method:
> As you can see, there is no way to "return" the error. So, currently,
> I just throw it. I could take an alternate approach. (I could have
> something like a "errno" in the class, and do stuff like this.)
> What do you think? Should I take this approach? Should I take
> another approach? Or what?
Personally I prefer the approach you have that throws when things have gone wrong.
If an API user doesn't do any error checking at all, then throwing will alert them when something goes wrong. Whereas an unchecked errno remains forever silent until the program crashes as a result of the failure, but in a subtle way some time later...