[ 
https://issues.apache.org/jira/browse/CMIS-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14041996#comment-14041996
 ] 

Florian Müller commented on CMIS-816:
-------------------------------------

There is one-time effort of wrapping all CMIS operations. Have a look at the 
ConformanceCmisServiceWrapper. It already does that and catches and handles all 
non-CMIS exceptions. Since programming errors are binding agnostic, this is the 
logical extension point to handle them.
It's not necessary to replicate the HTTP status code mapping. Just let the 
service wrapper throw the appropriate CMIS exception, which could be a 
different one or the same exception with a different error message. The 
framework still does the transformation into HTTP status codes.
If you want a completely different status code (which is not recommend for 
interoperability), don't throw a new exception, get the HTTP servlet response 
from the call context and return whatever you want.
Regarding the CSS: It only exists in the AtomPub binding implementation and an 
end-user should never see this. There is also some OpenCMIS specific convention 
in the returned HTML message. It's easy to break that if you return something 
custom. So, better not touch it.


> Allow custom error handling in the AtomPub and Browser bindings
> ---------------------------------------------------------------
>
>                 Key: CMIS-816
>                 URL: https://issues.apache.org/jira/browse/CMIS-816
>             Project: Chemistry
>          Issue Type: Improvement
>          Components: opencmis-server
>    Affects Versions: OpenCMIS 0.11.0
>            Reporter: Carlo Sciolla
>            Priority: Critical
>         Attachments: protected-error-handling.patch
>
>
> The AtomPub and Browser bindings servlets implement exception handling 
> through private methods which are thus not extensible by end users. 
> This effectively inhibit fine grained control over error reporting, logging 
> or contents of the error messages.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to