Commit e6cfb4e5 authored by Andy Wilkinson's avatar Andy Wilkinson

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
parent aa25bfb0
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 { ...@@ -247,7 +247,7 @@ public class JarFile extends java.util.jar.JarFile {
try { try {
return createJarFileFromEntry(entry); return createJarFileFromEntry(entry);
} }
catch (IOException ex) { catch (Exception ex) {
throw new IOException( throw new IOException(
"Unable to open nested jar file '" + entry.getName() + "'", ex); "Unable to open nested jar file '" + entry.getName() + "'", ex);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment