This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new c246d6ac81 Better error handling
c246d6ac81 is described below
commit c246d6ac81f4573d9ad7a9e80d3908d6f99719f2
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Jun 30 20:35:16 2026 +0100
Better error handling
NPE is also possible. Use Exception just in case.
Don't return invalid value if the correct value is read but the stream
closure fails.
---
java/org/apache/catalina/ssi/SSIServletExternalResolver.java | 5 ++---
java/org/apache/catalina/startup/ContextConfig.java | 10 ++++------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
index 56ccefc9ce..9d9e104778 100644
--- a/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
+++ b/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
@@ -611,9 +611,8 @@ public class SSIServletExternalResolver implements
SSIExternalResolver {
if (urlConnection != null) {
try {
urlConnection.getInputStream().close();
- } catch (IOException ioe) {
- ExceptionUtils.handleThrowable(ioe);
- lastModified = 0;
+ } catch (Exception e) {
+ ExceptionUtils.handleThrowable(e);
}
}
}
diff --git a/java/org/apache/catalina/startup/ContextConfig.java
b/java/org/apache/catalina/startup/ContextConfig.java
index 440fabae25..db10192dd0 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1705,9 +1705,8 @@ public class ContextConfig implements LifecycleListener {
if (uc != null) {
try {
uc.getInputStream().close();
- } catch (IOException ioe) {
- ExceptionUtils.handleThrowable(ioe);
- globalTimeStamp = -1;
+ } catch (Exception e) {
+ ExceptionUtils.handleThrowable(e);
}
}
}
@@ -1726,9 +1725,8 @@ public class ContextConfig implements LifecycleListener {
if (uc != null) {
try {
uc.getInputStream().close();
- } catch (IOException ioe) {
- ExceptionUtils.handleThrowable(ioe);
- hostTimeStamp = -1;
+ } catch (Exception e) {
+ ExceptionUtils.handleThrowable(e);
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]