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/