summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2015-05-12 12:03:40 +0300
committerVaadin Code Review <review@vaadin.com>2015-05-12 13:37:05 +0000
commit2fc082d9ff8744e222adde7666dc0b3c1c5c761d (patch)
tree345e377380eb117ae77cfda6640038e8e4da50e4
parent26087a85313cdf0be8cb7ee4dea5cf90e4e130ec (diff)
downloadvaadin-framework-2fc082d9ff8744e222adde7666dc0b3c1c5c761d.tar.gz
vaadin-framework-2fc082d9ff8744e222adde7666dc0b3c1c5c761d.zip
Catch all Exceptions when trying to open a gzipped resource (#13653)
URLConnection.getInputStream may throw any IOException, not just FileNotFoundException. Additionally, catch and log unexpected non-IOExceptions just in case to keep the app from failing hard. Change-Id: Id7ce7ddee3de38ccd10d9e02e6c587a86b9cac96
-rw-r--r--server/src/com/vaadin/server/VaadinServlet.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java
index 053349a635..b30f6acf16 100644
--- a/server/src/com/vaadin/server/VaadinServlet.java
+++ b/server/src/com/vaadin/server/VaadinServlet.java
@@ -877,8 +877,13 @@ public class VaadinServlet extends HttpServlet implements Constants {
is = connection.getInputStream();
// set gzip headers
response.setHeader("Content-Encoding", "gzip");
- } catch (FileNotFoundException e) {
+ } catch (IOException e) {
// NOP: will be still tried with non gzipped version
+ } catch (Exception e) {
+ getLogger().log(
+ Level.FINE,
+ "Unexpected exception looking for gzipped version of resource "
+ + urlStr, e);
}
}
if (is == null) {