chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CMIS-816) Allow custom error handling in the AtomPub and Browser bindings
Date Tue, 24 Jun 2014 15:24:25 GMT

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

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

The CMIS spec defines the same HTTP status codes for a few CMIS exceptions. For example, constraint,
contentAlreadyExists, nameConstraintViolation, updateConflict, and versioning share the HTTP
status code 409.
The Browser binding also provides the exception name and therefore can be unambiguously mapped
to a Java exception. Unfortunately, the AtomPub binding doesn't provide any additional hint.
The OpenCMIS server sends the exception name in the body and clients that understand this
hint (OpenCMIS, DotCMIS,...) can throw the right exception. That's not in the spec and only
in the code.
The OpenCMIS clients don't rely on this hint and fall back to the next generic exception,
if the hint is not present. (For status code 409 this a constraint exception.)
If you would send a different body, this hint would be lost and AtomPub clients don't get
fine grained exceptions anymore. If that's a big deal depends on the client application.

The service wrappers let you intercept almost everything, in a binding agnostic way. You control
what is going in and your control what is going out. They have been introduced to customize
the server behavior.
Technically, the AtomPub and JSON exception bodies can also be overridden in a service wrapper.
But since it never was the intention of the service wrappers to do something binding specific,
that requires a bit more code.

i18n support is a different discussion. It's virtually impossible to add that without built-in
support in the OpenCMIS. If you have use case for that, please open another issue.

> 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)

Mime
View raw message