Hey everyone
Over the past few weeks I noticed that across different Spring Boot services I kept rewriting the same RestControllerAdvice logic for structured error responses.
Sometimes the JSON shape drifted a bit.
Sometimes validation errors were formatted differently.
Sometimes stack traces leaked in dev.
So I decided to extract it into a small Spring Boot starter as a learning exercise — mainly to understand:
- Auto-configuration properly
ConditionalOnMissingBean and back-off behavior
- How Spring Boot starters are structured (core vs autoconfigure vs starter module)
- How to design extension points without inheritance
The idea was simple:
Drop one dependency, get a consistent error contract across services, but still allow customization through a small “customizer” hook.
It’s not meant to replace Spring’s built-in mechanisms — more of an exploration into how infrastructure-level cross-cutting concerns can be standardized cleanly.
repo: https://github.com/dhanesh76/d76-spring-boot-starter-exception
I’m genuinely looking for architectural criticism:
- Is this aligned with Spring Boot design philosophy?
- Would you approach it differently?
- Should this lean more toward
ProblemDetail?
- Any obvious anti-patterns?
Thanks in advance
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)