Menu

#874 STAFRegister does not provide error message if RC != 0

All
open
nobody
STAFClient (7)
5
2007-01-05
2007-01-05
No

The STAFRegister method currently provides only a return code (in e.rc). It doesn't provide any additional information about the error in e.result if a problem occurrs when the makeConnection() method was called, even though the makeConnection() method provides an error message via it's errorBuffer argument.

This problem was found by Anthony Pioli. For more information, see https://sourceforge.net/forum/message.php?msg_id=4084319

In his case, he was getting an RC 10 from a STAFRegister request submitted via Python with no additional information to help debug the error. I sent him a debug version of libSTAF.so where I added a cout to provide the the content of the errorBuffer argument if an error occurred calling makeConnection() in RealSTAFRegister or RealSTAFRegisterUTF* in stafif/STAF.cpp.

To really fix this problem, we'll probably want to add an errorBuffer argument to STAFRegister (and probably STAFUnRegister), etc. (like we already do for the STAFSubmit method with the resultPtr and resultLength arguments). However, we'll need to make sure that this is done in a way that is backward compatible (which could take some doing). To provide a fix sooner, in the interim, we could choose to simply add the cout as I described above, and also check if an environment variable (e.g. STAFOUTPUTERRORONSTAFREGISTER) so that someone would only get this error info if requested (and we would document this.

Discussion


Log in to post a comment.