[MGNLDAM-700] DamDownloadServlet returns HTTP 200 when an exception is thrown Created: 16/Mar/17 Updated: 30/Aug/17 Resolved: 21/Jul/17 |
|
| Status: | Closed |
| Project: | Magnolia DAM Module |
| Component/s: | DAM Core |
| Affects Version/s: | 2.1.7 |
| Fix Version/s: | 2.2.6 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Edwin Guilbert | Assignee: | AntonĂn Juran |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | support | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Magnolia 5.4.7 |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Template: |
|
||||||||||||
| Patch included: |
Yes
|
||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||
| Release notes required: |
Yes
|
||||||||||||
| Date of First Response: | |||||||||||||
| Sprint: | Kromeriz 105 | ||||||||||||
| Story Points: | 5 | ||||||||||||
| Description |
|
DamDownloadServlet doesn't handle exceptions thrown within the doGet method:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
process(request, response);
} catch (Exception e) {
log.error("error during download", e);
}
}
If anything wrong happens when processing of the dam download, the exception thrown is only logged. The servlet should handle the error either throwing a new exception or taking care of the response manually. This affects cases like using a database for the repository (with a file system datastore) and deleting (or loosing connection in case of NFS) the datastore folder. When accessing an image through the dam servlet: |
| Comments |
| Comment by Christian Ringele [ 16/Mar/17 ] |
|
I added a patch. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { process(request, response); } catch (RuntimeRepositoryException e) { response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); log.error("error during download", e); } catch (Exception e) { log.error("error during download", e); } } |