Skip to content

Improve dispatcher error logging for client errors#1536

Merged
petersmythe merged 1 commit into
GeoWebCache:mainfrom
petersmythe:fix/improve-dispatcher-logging
May 31, 2026
Merged

Improve dispatcher error logging for client errors#1536
petersmythe merged 1 commit into
GeoWebCache:mainfrom
petersmythe:fix/improve-dispatcher-logging

Conversation

@petersmythe
Copy link
Copy Markdown
Contributor

Catch IllegalArgumentException separately in GeoWebCacheDispatcher and log at WARNING level with message only (no stack trace).

These are client errors (e.g. requesting an unsupported format like 'image/png is not a supported format for layer_name') that do not warrant a full stack trace at SEVERE level. The client still receives a proper 400 response with the error message.

Catch IllegalArgumentException separately in GeoWebCacheDispatcher and log at WARNING level with message only (no stack trace). These are client errors (e.g. requesting an unsupported format) that do not warrant a full stack trace at SEVERE level.
@petersmythe
Copy link
Copy Markdown
Contributor Author

Waiting on geoserver/geoserver#9538 to fix the broken tests

@petersmythe
Copy link
Copy Markdown
Contributor Author

Ignoring broken downstream (GeoServer) tests

@petersmythe petersmythe merged commit 8e61163 into GeoWebCache:main May 31, 2026
13 of 14 checks passed
@petersmythe petersmythe deleted the fix/improve-dispatcher-logging branch May 31, 2026 12:22
@aaime
Copy link
Copy Markdown
Member

aaime commented Jun 1, 2026

The premise that IllegalArgumentException represents a client error is incorrect. It is a general-purpose Java runtime exception thrown throughout the codebase for a wide range of conditions, including internal programming errors. Catching it at the dispatcher level and returning a 400 will silently misclassify genuine bugs as client mistakes, and dropping the stack trace means those bugs become undiagnosable in production.

Additionally, a behavior change of this kind should not be self-merged after 20 hours without review. You probably thought it was a harmless, small change, which is probably even worse, it shows that you have no understanding of the code change consequences.

Direct merges without review are for emergency usage only, and should be performed only by someone with a clear understanding of what they are doing.

@petersmythe
Copy link
Copy Markdown
Contributor Author

I am duly chastised. I am sorry.

@petersmythe
Copy link
Copy Markdown
Contributor Author

Superseded by geoserver/geoserver#9552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants