On Thu, 2003-03-20 at 07:46, Michael Bell wrote:
ps: why on OpenCA modules you implement errno and errval as package variables, instead of instantiated variables???
If the object crashs during initialization then $object->{errno} doesn't work. Therefore we used $OpenCA::X509::errno. If you use more than one object then you loose old errorcodes. This is a known problem.
It would only fail if the error gets called before blessing the instance variable, which can be perfectly controlled. It doesn't matter a lot anyway, but I thought it's not nice...
We use a different behaviour. If there is something going wrong during initialization then we don't return the object. This is the best way to signal a user that new doesn't work correctly. If for example a sql database is not running and you call OpenCA::DBI->new then new returns undef to avoid any usage of the object but the user can check the errorcode and errormessage.
It is not a secret that it doesn't look nice but it is the most robust way. Would it help you if we have errval and errno package-based and object-based? $OpenCA::OpenSSL::errno contains the last error and $cryptoShell->{errno} or perhaps better $cryptoShell->errno contains/returns the last error of the object.
What do you think? We are open for constructive criticism at every time.
Greeting Michael -- ------------------------------------------------------------------- Michael Bell Email: [EMAIL PROTECTED] ZE Computer- und Medienservice Tel.: +49 (0)30-2093 2482 (Computing Centre) Fax: +49 (0)30-2093 2704 Humboldt-University of Berlin Unter den Linden 6 10099 Berlin Email (private): [EMAIL PROTECTED] Germany http://www.openca.org
-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC. Does your code think in ink? You could win a Tablet PC. Get a free Tablet PC hat just for playing. What are you waiting for? http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
OpenCA-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-devel