From e6cfb4e5fb95ea9bc0f590f37706c543429f57a2 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 24 Mar 2017 10:30:04 +0000 Subject: [PATCH] Improve diagnostics when reading a nested jar throws a runtime exception Previously, only IOExceptions were caught and wrapped in a new IOException that included the name of the nested entry that was being read. Following this commit, any Exception is caught and wrapped so that the problematic entry can be identified in more failure scenarios. Closes gh-8711 --- .../java/org/springframework/boot/loader/jar/JarFile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java index e0a2741dfcd..9c6bf000611 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -247,7 +247,7 @@ public class JarFile extends java.util.jar.JarFile { try { return createJarFileFromEntry(entry); } - catch (IOException ex) { + catch (Exception ex) { throw new IOException( "Unable to open nested jar file '" + entry.getName() + "'", ex); }