This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new d5be3d9f83 Add debug logging for exceptions when parsing parts
d5be3d9f83 is described below

commit d5be3d9f83dcc00ca0bd4f01fd879cdf3469bc02
Author: remm <r...@apache.org>
AuthorDate: Tue Jun 24 14:50:49 2025 +0200

    Add debug logging for exceptions when parsing parts
    
    It is possible that frameworks swallow exceptions.
---
 java/org/apache/catalina/connector/LocalStrings.properties | 1 +
 java/org/apache/catalina/connector/Request.java            | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/connector/LocalStrings.properties 
b/java/org/apache/catalina/connector/LocalStrings.properties
index c4951cf966..de2de4a15c 100644
--- a/java/org/apache/catalina/connector/LocalStrings.properties
+++ b/java/org/apache/catalina/connector/LocalStrings.properties
@@ -64,6 +64,7 @@ coyoteRequest.maxPostSizeExceeded=The multi-part request 
contained parameter dat
 coyoteRequest.noAsync=Unable to start async because the following classes in 
the processing chain do not support async [{0}]
 coyoteRequest.noMultipartConfig=Unable to process parts as no multi-part 
configuration has been provided
 coyoteRequest.parseParameters=Exception thrown whilst processing POSTed 
parameters
+coyoteRequest.partsParseException=Exception [{0}] occurred parsing parts and 
will be thrown
 coyoteRequest.postTooLarge=Parameters were not parsed because the size of the 
posted data was too big. Use the maxPostSize attribute of the connector to 
resolve this if the application should accept large POSTs.
 coyoteRequest.sendfileNotCanonical=Unable to determine canonical name of file 
[{0}] specified for use with sendfile
 coyoteRequest.sessionCreateCommitted=Cannot create a session after the 
response has been committed
diff --git a/java/org/apache/catalina/connector/Request.java 
b/java/org/apache/catalina/connector/Request.java
index b34e7e148c..fbcc700047 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2578,6 +2578,10 @@ public class Request implements HttpServletRequest {
         parseParts(true);
 
         if (partsParseException != null) {
+            Context context = getContext();
+            if (context != null && context.getLogger().isDebugEnabled()) {
+                
context.getLogger().debug(sm.getString("coyoteRequest.partsParseException", 
partsParseException.getMessage()));
+            }
             if (partsParseException instanceof IOException) {
                 throw (IOException) partsParseException;
             } else if (partsParseException instanceof IllegalStateException) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to