axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Hoyt <>
Subject Re: Custom Error Messages
Date Thu, 13 Nov 2008 22:42:09 GMT
--- On Wed, 11/12/08, Dinesh Premalal <> wrote:

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..." );
  (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.


"Opportunities multiply as they are seized." - Sun Tzu


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message