aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2015-05-12 12:03:40 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2015-05-12 12:03:40 +0300
commit52b602ed2e8ca7cbad266b59c45e916cb8394b56 (patch)
treecd8ede6c18fd48dcc5bae79f043ce72824dbee1f /server
parent571d31bb099624703dfe0444f6b0e379db6956d6 (diff)
downloadvaadin-framework-52b602ed2e8ca7cbad266b59c45e916cb8394b56.tar.gz
vaadin-framework-52b602ed2e8ca7cbad266b59c45e916cb8394b56.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
Diffstat (limited to 'server')
-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) {