[
https://issues.apache.org/jira/browse/SLING-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12921978#action_12921978
]
Carsten Ziegeler commented on SLING-1842:
-----------------------------------------
> > Maybe we shouldn't throw at all if the writer can't be retrieved?
> This is mandated by the servlet API spec, which says getWriter must throw an
> IllegalStateException if the output stream has already been retrieved
Sure, but handleError is called if an error occured, so someone else already
threw an exception - if now - for whatever reason - getWriter in the error
handling phase throws an exception, this might be a follow-up problem of the
first exception - or not; doesn't really matter - the important error is still
the first one which caused the error handler to be called. So throwing an
exception on getWriter shadows the real exception
But I'm fine with any improvements in this error even if we rethrow on
getWriter :)
> IllegalStateException in DefaultErrorHandlerServlet when
> HttpServletResponse.getOutputStream() already called
> -------------------------------------------------------------------------------------------------------------
>
> Key: SLING-1842
> URL: https://issues.apache.org/jira/browse/SLING-1842
> Project: Sling
> Issue Type: Bug
> Components: Servlets
> Reporter: Carl Hall
> Attachments: SLING-1842.diff
>
>
> When getOutputStream() has been called, DefaultErrorHandlerServlet is unable
> to write the error page and dumps an exception in the logs. It'd be nice if
> it failed a bit more gracefully.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.