All notable changes to this project are documented here. The format is based on Keep a Changelog.
First public release of errx-java, a Java-native structured error handling
library with optional Spring Boot integration.
ErrxException— singleRuntimeExceptioncarrying a machine-readablecode, a typedErrorType, positionalargs, validationfields, and debuggingdetails.ErrorTypeenum —INTERNAL,VALIDATION,NOT_FOUND,CONFLICT,AUTH,FORBIDDEN,THROTTLING. Each carries its HTTP status (NOT_FOUND→ 400, because 404 is reserved for routing-level misses).- Builder-based API:
ErrxException.create().code(...).type(...).args(...).build(). .message(String)— opt into an explicit (non-translated) message that bypasses i18n lookup.- Static utilities:
getCode,getType,isCodeIn,asErrxException,wrapWithTypeOnCodes,wrap. - Native Java cause chain + stack traces — no custom trace string.
- Immutable after construction:
fields()anddetails()return unmodifiable maps;args()returns a defensive copy.
ErrxExceptionHandler(@RestControllerAdvice) — convertsErrxExceptioninto a structuredErrorResponseand mapsErrorTypeto HTTP status.- i18n message resolution — the exception's
codedoubles as theMessageSourcekey. Locale is read fromLocaleContextHolder(populated from theAccept-Languageheader). - Bean Validation support —
MethodArgumentNotValidExceptionandConstraintViolationExceptionare mapped tovalidation.failedwith per-field messages. ErrxExceptionAutoConfiguration— registers the handler automatically with any availableMessageSource. Backs off if the user defines their ownErrxExceptionHandlerbean.- Response body:
{ code, message, fields?, timestamp }. The exception'stypeis intentionally not included — the HTTP status conveys the category. - Logging — 5xx at ERROR with the full cause chain, 4xx at WARN.
detailsappear in server logs but never in responses.