mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Untangle try-catch a bit in servlet, to properly catch 404 errors
This commit is contained in:
parent
937d087365
commit
7f300ce09a
|
@ -204,8 +204,6 @@ public final class DecodeServlet extends HttpServlet {
|
|||
connection.setRequestProperty(HttpHeaders.USER_AGENT, "zxing.org");
|
||||
connection.setRequestProperty(HttpHeaders.CONNECTION, "close");
|
||||
|
||||
try {
|
||||
|
||||
try {
|
||||
connection.connect();
|
||||
} catch (IOException ioe) {
|
||||
|
@ -234,15 +232,12 @@ public final class DecodeServlet extends HttpServlet {
|
|||
|
||||
log.info("Decoding " + imageURL);
|
||||
processStream(is, request, response);
|
||||
|
||||
} catch (IOException ioe) {
|
||||
log.info(ioe.toString());
|
||||
response.sendRedirect("badurl.jspx");
|
||||
} finally {
|
||||
consumeRemainder(is);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException ioe) {
|
||||
log.info(ioe.toString());
|
||||
response.sendRedirect("badurl.jspx");
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue