--- On Wed, 11/12/08, Dinesh Premalal <[EMAIL PROTECTED]> wrote:
> http://nethu.org/2008/01/18/axis2c-custom-error-handling/
I tried your example and it wouldn't work for me, namely because the compiler
could not link up the axutil_error_messages array in src\error.c. I figure this
might be a C++ issue, since that's the platform I'm working on, but that's not
important at the moment.
I did manage to get the following three lines to work..
axutil_error_set_error_message( env->error,
"This is my custom error message..." );
AXIS2_ERROR_SET(env->error,
(enum axutil_error_codes)(AXUTIL_ERROR_MAX + 1), AXIS2_FAILURE);
return NULL;
BUT, to do this with code generated by WSDL2C, I had to edit the
axis2_svc_skel_myService_invoke() generated function. In this invoke function,
it calls all the operations and looks to see if the return value is NULL. If
it is NULL, it sets it's OWN error message, and returns that to the user. This
is undesirable behavior for me, I would like it if the invoke() call could
check to see if the user has already set an error message. If not, then set
it's own error message, else, it would pass the user generated error message
down and eventually back to the user.
As such, their should be some kind of axutil_error_get_error_number() function,
that allows the user to see if an error code has been set.
Otherwise, I can hack the generated code for now, but in the future, I would
have rather had the system just allow me to specify my own error messages back
to the user.
Tony
"Opportunities multiply as they are seized." - Sun Tzu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]