[Win32utils-devel] Re: code cleanup suggestion - error classes

win32utils-devel at rubyforge.org win32utils-devel at rubyforge.org
Sat Jan 24 16:09:33 EST 2004


> Currently, most of the modules define an error class of some sort (e.g.
> cWin32ServiceError).  Within the code, the error is raised like this:
> rb_raise(cWin32ServiceError,ErrorDescription(GetLastError()));
> It seems logical that, instead of appending the message every time, that
> we should simply call ErrorDescription(GetLastError()) simply by raising
> an error (i.e. within the 'initialize' method of cWin32ServiceError).
> In other words, you would simply have to do:
> rb_raise(cWin32ServiceError);
> And it would automatically include the error description.
> Seem reasonable?

Yes, it seems reasonable. But I have not delved into this any deeper,
so my opinion is just that.

> Dan
> PS - Park and Shashank, I thought it might be better if we send our
> emails to the mailing list I setup rather than to each other directly.
> That way there's an archive of our discussions for others to look at if
> they want.  I think I'll have to approve the first email you send to the
> list (the list is moderated), but I think I can configure it so that I
> only have to do that once.  After that, you should be able to post
> freely. :) 

That is a good idea ...
-- Shashank

More information about the win32utils-devel mailing list