Repository navigation
fix(exception): log 4xx at WARN without a stack trace, keep ERROR for 5xx. CU-17tkuw5vn1y - #2887
Merged
Merged
Conversation
… 5xx. CU-17tkuw5vn1y BaseGlobalExceptionHandler logged every BaseException (not found, bad request, conflict) and missing header / method / media type errors at ERROR with a full stack trace, so a caller's typo looked like a server fault and flooded the logs. - BaseException: 5xx -> ERROR with stack trace, anything else -> WARN with the message only - missing header, method not supported, media type not supported: WARN with the message only - IllegalArgumentException (400): WARN, stack trace kept because our own code throws it too (bad UUID or number in stored data) - first tests for the module (spring-boot-starter-test, test scope)
Contributor
🦩 Flamingo Code ReviewNot reviewed yet. Reviews start when you ask, so the reviewer reads this pull request when it is ready, not when it is opened. When it is ready:
Or comment Updated 2026-10-29 19:39 UTC · workflow run |
aliaska-varieva
enabled auto-merge
October 29, 2026 19:46
pavlo-flamingo
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
BaseGlobalExceptionHandlerlogs everyBaseExceptionat ERROR with a full stack trace, including 4xx ones (NotFoundException,BadRequestException, conflicts). Missing header, method-not-supported and media-type errors are logged the same way.A caller asking for an unknown id therefore shows up in logs and alerts as a server fault. Example on prod (
openframe-saas-management-api):NOT_FOUND: Device … not foundlogged at ERROR with its stack trace.Fix
BaseException, 4xxBaseException, 5xxIllegalArgumentException(400)Response bodies and statuses are unchanged; only log levels change.
Tests
BaseGlobalExceptionHandlerLoggingTest(the module's first tests) checks level and stack trace per case.openframe-external-api-service-coreGlobalExceptionHandlerTeststill passes (20).Follow-up
After the lib release and bump, the
NotFoundExceptionhandler added in openframe-saas-shared#2782 (management-api) duplicates this and can be removed.Change-Set: exception-4xx-warn
Change set
flamingo-stack/exception-4xx-warn: this pull request is the only one in it so far. Another pull request joins by naming this one in aDepends-Online, or by carrying the sameChange-Setline.Linked work
Linked by the
Depends-On/Change-Setlines in these descriptions; this block is maintained by the hub.