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

remm 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 4f6744936e Add debug logging for exceptions when parsing 
parameters/parts
4f6744936e is described below

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

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

diff --git a/java/org/apache/catalina/connector/LocalStrings.properties 
b/java/org/apache/catalina/connector/LocalStrings.properties
index 4d89bb3f93..211566bea6 100644
--- a/java/org/apache/catalina/connector/LocalStrings.properties
+++ b/java/org/apache/catalina/connector/LocalStrings.properties
@@ -62,7 +62,9 @@ coyoteRequest.gssLifetimeFail=Failed to obtain remaining 
lifetime for user princ
 coyoteRequest.maxPostSizeExceeded=The multi-part request contained parameter 
data (excluding uploaded files) that exceeded the limit for maxPostSize set on 
the associated connector
 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.parametersParseException=Exception [{0}] occurred parsing 
parameters and will be thrown
 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 4100206667..6f4d313928 100644
--- a/java/org/apache/catalina/connector/Request.java
+++ b/java/org/apache/catalina/connector/Request.java
@@ -2441,6 +2441,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) {
@@ -2815,6 +2819,10 @@ public class Request implements HttpServletRequest {
         doParseParameters();
 
         if (parametersParseException != null) {
+            Context context = getContext();
+            if (context != null && context.getLogger().isDebugEnabled()) {
+                
context.getLogger().debug(sm.getString("coyoteRequest.parametersParseException",
 parametersParseException.getMessage()));
+            }
             throw parametersParseException;
         }
     }


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

Reply via email to