[
https://issues.apache.org/jira/browse/SLING-6515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15931641#comment-15931641
]
Konrad Windszus edited comment on SLING-6515 at 3/19/17 2:47 PM:
-----------------------------------------------------------------
It is not possible to influence Error Response Message with the current
AbstractPostResponse.java:220 setError method implementation
(https://github.com/apache/sling/blob/4df9ab2d6592422889c71fa13afd453a10a5a626/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostResponse.java#L221).
In case of exception it creates a new SlingException and instead of taking
original Throwable error as parameter, sets null.
AbstractPostResponse method:
{code}
public void setError(Throwable *error*) {
setProperty(PN_ERROR, new SlingException("Exception during response
processing.", null));
}
{code}
Because of this method, the Response message is always the same.
was (Author: kama):
It is not possible to influence Error Response Message with the current
AbstractPostResponse.java:220 setError method implementation
(https://github.com/apache/sling/blob/4df9ab2d6592422889c71fa13afd453a10a5a626/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostResponse.java#L221).
In case of exception it creates a new SlingException and instead of taking
original Throwable error as parameter, sets null.
AbstractPostResponse method:
public void setError(Throwable *error*) {
setProperty(PN_ERROR, new SlingException("Exception during response
processing.", null));
}
Because of this method, the Response message is always the same.
> Sling Post Processor considering validation model as well
> ---------------------------------------------------------
>
> Key: SLING-6515
> URL: https://issues.apache.org/jira/browse/SLING-6515
> Project: Sling
> Issue Type: Improvement
> Components: Validation
> Reporter: Konrad Windszus
>
> It should be possible to optionally enable a Sling Post Processor which
> validates the incoming parameters against a validation model. In case the
> incoming parameters are not valid, there must be an error response.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)