[jira] [Commented] (SLING-7552) SlingPostServlet error handling still insufficient
[ https://issues.apache.org/jira/browse/SLING-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16507846#comment-16507846 ] Jörg Hoh commented on SLING-7552: - [~asanso] A, good find. That's probably the least intrusive patch for it. Please validate the updated patch [^SLING-7552-2-patch.diff]. A short test on my system showed that the behavior is changed now. > SlingPostServlet error handling still insufficient > -- > > Key: SLING-7552 > URL: https://issues.apache.org/jira/browse/SLING-7552 > Project: Sling > Issue Type: Improvement > Components: Servlets >Affects Versions: Servlets Post 2.3.24 >Reporter: Jörg Hoh >Priority: Major > Labels: patch > Attachments: SLING-7552-2-patch.diff, SLING-7552-patch.diff > > > At the moment the default errorhandling of Sling [1] cannot be used for > errors caused and handled by the SlingPostServlet itself. It will always > return its own custom output without the chance of customizing it. Although > Antonio and Justing worked in SLING-2156 to improve this situation, it still > requires extra work (implementing a PostResponseWithErrorHandling). It would > be better if the output could be customized by the "standard error handling". > > How to reproduce: > * create an error handling script in > /apps/sling/servlet/errorhandler/default.jsp which creates some random output. > * Validate this script config by doing a request which causes some exception > (do not use the SlingPostServlet here) > * Do a POST to the Sling instance which results in an exception (e.g. due to > insufficient permissions. > * The output of the second call is completely determined by the > SlingPostServlet, the default error handling does not kick in. > Proposed solution: > * The SlingPostServlet should not swallow the exception and handle it by > itself, but rather re-throw it, so the standard error handling is triggered. > > [1] http://sling.apache.org/documentation/the-sling-engine/errorhandling.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SLING-7552) SlingPostServlet error handling still insufficient
[ https://issues.apache.org/jira/browse/SLING-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16488820#comment-16488820 ] Antonio Sanso commented on SLING-7552: -- [~joerghoh] maybe a less invasive solution would be to change the default for {{PostResponseWithErrorHandling}} to {{true}} see [0] [0]https://github.com/apache/sling-org-apache-sling-servlets-post/blob/master/src/main/java/org/apache/sling/servlets/post/impl/PostResponseWithErrorHandling.java#L59 > SlingPostServlet error handling still insufficient > -- > > Key: SLING-7552 > URL: https://issues.apache.org/jira/browse/SLING-7552 > Project: Sling > Issue Type: Improvement > Components: Servlets >Affects Versions: Servlets Post 2.3.24 >Reporter: Jörg Hoh >Priority: Major > Labels: patch > Attachments: SLING-7552-patch.diff > > > At the moment the default errorhandling of Sling [1] cannot be used for > errors caused and handled by the SlingPostServlet itself. It will always > return its own custom output without the chance of customizing it. Although > Antonio and Justing worked in SLING-2156 to improve this situation, it still > requires extra work (implementing a PostResponseWithErrorHandling). It would > be better if the output could be customized by the "standard error handling". > > How to reproduce: > * create an error handling script in > /apps/sling/servlet/errorhandler/default.jsp which creates some random output. > * Validate this script config by doing a request which causes some exception > (do not use the SlingPostServlet here) > * Do a POST to the Sling instance which results in an exception (e.g. due to > insufficient permissions. > * The output of the second call is completely determined by the > SlingPostServlet, the default error handling does not kick in. > Proposed solution: > * The SlingPostServlet should not swallow the exception and handle it by > itself, but rather re-throw it, so the standard error handling is triggered. > > [1] http://sling.apache.org/documentation/the-sling-engine/errorhandling.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SLING-7552) SlingPostServlet error handling still insufficient
[ https://issues.apache.org/jira/browse/SLING-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16462481#comment-16462481 ] Robert Munteanu commented on SLING-7552: [~asanso] / [~justinedelson] - any thoughts on the patch proposed by Jörg? > SlingPostServlet error handling still insufficient > -- > > Key: SLING-7552 > URL: https://issues.apache.org/jira/browse/SLING-7552 > Project: Sling > Issue Type: Improvement > Components: Servlets >Affects Versions: Servlets Post 2.3.24 >Reporter: Jörg Hoh >Priority: Major > Labels: patch > Attachments: SLING-7552-patch.diff > > > At the moment the default errorhandling of Sling [1] cannot be used for > errors caused and handled by the SlingPostServlet itself. It will always > return its own custom output without the chance of customizing it. Although > Antonio and Justing worked in SLING-2156 to improve this situation, it still > requires extra work (implementing a PostResponseWithErrorHandling). It would > be better if the output could be customized by the "standard error handling". > > How to reproduce: > * create an error handling script in > /apps/sling/servlet/errorhandler/default.jsp which creates some random output. > * Validate this script config by doing a request which causes some exception > (do not use the SlingPostServlet here) > * Do a POST to the Sling instance which results in an exception (e.g. due to > insufficient permissions. > * The output of the second call is completely determined by the > SlingPostServlet, the default error handling does not kick in. > Proposed solution: > * The SlingPostServlet should not swallow the exception and handle it by > itself, but rather re-throw it, so the standard error handling is triggered. > > [1] http://sling.apache.org/documentation/the-sling-engine/errorhandling.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (SLING-7552) SlingPostServlet error handling still insufficient
[ https://issues.apache.org/jira/browse/SLING-7552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16436965#comment-16436965 ] Jörg Hoh commented on SLING-7552: - I attached a patch, which just removes the error handling inside the SlingPostServlet and the AbstractPostOperation classes and throws the exception instead. I don't like that the fact, that SlingRequestProcessor does not do call {{handleError}} when handling an IOException, but rather re-throws it as well. So in an case of an exception the SlingPostSerlvet has to wrap the IOException into an RuntimeException to trigger the {{handleError}} method in the SlingRequestProcessor. Open for better ideas. > SlingPostServlet error handling still insufficient > -- > > Key: SLING-7552 > URL: https://issues.apache.org/jira/browse/SLING-7552 > Project: Sling > Issue Type: Improvement > Components: Servlets >Affects Versions: Servlets Post 2.3.24 >Reporter: Jörg Hoh >Priority: Major > Attachments: SLING-7552-patch.diff > > > At the moment the default errorhandling of Sling [1] cannot be used for > errors caused and handled by the SlingPostServlet itself. It will always > return its own custom output without the chance of customizing it. Although > Antonio and Justing worked in SLING-2156 to improve this situation, it still > requires extra work (implementing a PostResponseWithErrorHandling). It would > be better if the output could be customized by the "standard error handling". > > How to reproduce: > * create an error handling script in > /apps/sling/servlet/errorhandler/default.jsp which creates some random output. > * Validate this script config by doing a request which causes some exception > (do not use the SlingPostServlet here) > * Do a POST to the Sling instance which results in an exception (e.g. due to > insufficient permissions. > * The output of the second call is completely determined by the > SlingPostServlet, the default error handling does not kick in. > Proposed solution: > * The SlingPostServlet should not swallow the exception and handle it by > itself, but rather re-throw it, so the standard error handling is triggered. > > [1] http://sling.apache.org/documentation/the-sling-engine/errorhandling.html -- This message was sent by Atlassian JIRA (v7.6.3#76005)