win32utils-devel@rubyforge.org
2004-Jan-22 09:54 UTC
[Win32utils-devel] code cleanup suggestion - error classes
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? 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. :)
win32utils-devel@rubyforge.org
2004-Jan-24 17:32 UTC
[Win32utils-devel] Re: code cleanup suggestion - error classes
Dan,> 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