This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 5b0ffcccbc Better error handling
5b0ffcccbc is described below
commit 5b0ffcccbc4e2ba1038fc058c5a02a48ee935436
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 77e518fa43..21eaa63365 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1706,9 +1706,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);
}
}
}
@@ -1727,9 +1726,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]