You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@syncope.apache.org by Oliver Wulff <ow...@talend.com> on 2014/01/26 23:09:36 UTC

RestServiceExceptionMapper

Hi there

I noticed that Syncope gives more detailed exception information back in the RestServiceExceptionMapper by using the enum SyncopeClientExceptionType. The exception information is returned in the HTTP response header 'ExceptionType'.

I've found in some sources ([1],[2]) that this kind of information could be returned in the http header X-Application-Error-Code and X-Application-Error-Info. What do you think about considering to change the header in 1.2 to X-Application-Error-Code instead of ExceptionType?

What do you think about it?

Thanks
Oli

[1] https://github.com/FriendsOfSymfony/FOSRestBundle/issues/280
[2] http://www.taliferro.com/29-rest-services-tips/

Re: RestServiceExceptionMapper

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 26/01/2014 23:09, Oliver Wulff wrote:
> Hi there
>
> I noticed that Syncope gives more detailed exception information back in the RestServiceExceptionMapper by using the enum SyncopeClientExceptionType. The exception information is returned in the HTTP response header 'ExceptionType'.
>
> I've found in some sources ([1],[2]) that this kind of information could be returned in the http header X-Application-Error-Code and X-Application-Error-Info. What do you think about considering to change the header in 1.2 to X-Application-Error-Code instead of ExceptionType?
>
> What do you think about it?

Hi Oliver,
I've been searching for some more references about 
X-Application-Error-Code and X-Application-Error-Info HTTP headers and 
it looks they do have some consensus out there.

As you will see, things are quite different in trunk (1.2.0-SNAPSHOT) - 
see [3] and [4] - and should already be in the direction of your 
proposed change.
The only problem I could see is in case of composite exceptions [5] 
where multiple exception headers need to be returned and there should be 
some mechanism for binding the "error-code" with "info" information.

Anyway, please file an improvement on JIRA targeted to 1.2.0.

Regards.

> [1] https://github.com/FriendsOfSymfony/FOSRestBundle/issues/280
> [2] http://www.taliferro.com/29-rest-services-tips/
[3] 
http://svn.apache.org/repos/asf/syncope/trunk/client/src/main/java/org/apache/syncope/client/rest/RestClientExceptionMapper.java
[4]http://svn.apache.org/repos/asf/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/utils/RestServiceExceptionMapper.java
[5] 
http://svn.apache.org/repos/asf/syncope/trunk/common/src/main/java/org/apache/syncope/common/SyncopeClientCompositeException.java

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


Re: RestServiceExceptionMapper

Posted by Fabio Martelli <fa...@gmail.com>.
Il 26/01/2014 23:09, Oliver Wulff ha scritto:
> Hi there
>
> I noticed that Syncope gives more detailed exception information back in the RestServiceExceptionMapper by using the enum SyncopeClientExceptionType. The exception information is returned in the HTTP response header 'ExceptionType'.
>
> I've found in some sources ([1],[2]) that this kind of information could be returned in the http header X-Application-Error-Code and X-Application-Error-Info. What do you think about considering to change the header in 1.2 to X-Application-Error-Code instead of ExceptionType?
>
> What do you think about it?
>
> Thanks
> Oli
>
> [1] https://github.com/FriendsOfSymfony/FOSRestBundle/issues/280
> [2] http://www.taliferro.com/29-rest-services-tips/
>
Hi Oliver, maybe you are right.
I'm not sure but tho proposed change seems to be more compliant with 
REST best practices.
I'm afraid about the considerable work required for .... BTW .... +1.

Regards,
F.

-- 
Fabio Martelli

Tirasa - Open Source Excellence
http://www.tirasa.net/

Apache Syncope PMC
http://people.apache.org/~fmartelli/