> Senaka Fernando wrote:
>> Hi all,
>>
>> How about AXIS2_ERROR_SET_AND_LOG(env->error, ...) a new macro which
>> combines the AXIS2_ERROR_SET() and AXIS2_LOG_ERROR().
>>
>
> What if we wanted to do more with this macro in the future? e.g.
> AXIS2_ERROR_SET_AND_LOG_AND_FOO_AND_BAR(env->error, ...) ?
>
> So why not AXIS2_HANDLE_ERROR(env->error, ...) or something like that.
> Where HANDLE ==> SET_AND_LOG_AND_FOO_AND_BAR

+1,
That's even better.

HANDLE makes sense because, both LOG and SET, and most probably any future
FOO and BAR would rather be related to handling an error. Therefore, we
can add a AXIS2_HANDLE_ERROR().

This method will accept four parameters in an attempt to keep the profile
low, having in mind the possibility of extending this in the future.

1. env (out of which log and error can be obtained)
2. error_number (ex:- AXIS2_ERROR_MULTIPLE_CODE_ELEMENTS_ENCOUNTERED)
3. status_code
4. AXIS2_LOG_SI

BTW, is AXIS2_LOG_SI required? Can't this be embedded in the macro?

Also, I will create a JIRA Issue on this.

Regards,
Senaka

>
> Samisa...
>> Thoughts?
>>
>> Regards,
>> Senaka
>>
>>
>>> Hi,
>>> When we do AXIS2_ERROR_SET, we have to log an error message as well. In
>>> "some" situations we can use the same error message we set to the
>>> env->error for logging. Like this
>>>
>>> AXIS2_ERROR_SET(env->error,
>>>
>>> AXIS2_ERROR_MULTIPLE_CODE_ELEMENTS_ENCOUNTERED,
>>>                                AXIS2_FAILURE);
>>> AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>>>                       AXIS2_ERROR_GET_MESSAGE(env->error));
>>>
>>> instead of
>>>
>>> AXIS2_ERROR_SET(env->error,
>>>
>>> AXIS2_ERROR_MULTIPLE_CODE_ELEMENTS_ENCOUNTERED,
>>>                                AXIS2_FAILURE);
>>> AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>>>                       "Multiple  fault code elements encountered in
>>> SOAP
>>> fault");
>>>
>>> If the message is detailed enough for logging I do not see any problem
>>> of doing this. Do you?
>>>
>>> Cheers,
>>> Kaushalye
>>>
>>> --
>>> http://blog.kaushalye.org/
>>> http://wso2.org/
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>>
>
>
> --
> Samisa Abeysinghe
> Software Architect; WSO2 Inc.
>
> http://www.wso2.com/ - "Oxygenating the Web Service Platform."
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to