On Wed, Feb 11, 2015 at 6:48 PM, Pulasthi Mahawithana <[email protected]>
wrote:
> Hi,
>
> What would be the correct approach for handling exceptions at admin
> services? Is it to throw the wrapped exception("throw new
> FooException(message, e)"), or to throw the exception without wrapping the
> original exception ("throw new FooException(message)")? (in both cases
> exception is logged before throwing)
>
> If it is the first way, the exception's stacktrace will be duplicated if
> both client and server are in single machine. And the exception stacktrace
> at client would have information that should not be sent to the client
> (e.g. SQL queries)
>
I believe this is a problem in axis2 client, logging the stack trace,
correct me if I am wrong. So it is a special case in our platform, because
you are logging it in the service level and axis2 client logs it once again
you have two logs. We can't eliminate the service level log if we think
about a real remote client that is invoking admin service.
>
> If it the second way, the client will not be able to have the exact cause
> for the exception, which the client may find useful. So what could be the
> best option for this? Are there any better ways handling this?
>
This way client looses valuable information.
So first approach may be better here IMO. Another thing to keep in mind is
to make sure no sensitive information is exposed in the messages. If this
can be handled then option 2 is good I believe.
Others might have different opinions.
>
> --
> *Pulasthi Mahawithana*
> Software Engineer
> WSO2 Inc., http://wso2.com/
> Mobile: +94-71-5179022
> Blog: http://blog.pulasthi.org
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Thanks & Regards,
*Johann Dilantha Nallathamby*
Associate Technical Lead & Product Lead of WSO2 Identity Server
Integration Technologies Team
WSO2, Inc.
lean.enterprise.middleware
Mobile - *+94777776950*
Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev