Uses of Class
com.broadleafcommerce.common.error.ApiError
Packages that use ApiError
Package
Description
-
Uses of ApiError in com.broadleafcommerce.common.error
Methods in com.broadleafcommerce.common.error that return ApiErrorModifier and TypeMethodDescriptionApiError.withErrorRef(String errorRef) Unique reference code for support and logs correlationApiError.withException(String exception) Optional exception class nameApiError.withGlobalErrors(List<GlobalError> globalErrors) Optionally gives additional information to the client about what was wrong with their requestApiError.withStatus(org.springframework.http.HttpStatusCode status) Should always match exactly the status in the response header.ApiError.withStatusCode(int statusCode) Numerical representation ofstatusApiError.withTimestamp(OffsetDateTime timestamp) When the error occurred, defaults toLocalDateTime.now()A human-readable representation of the type of error being returnedApiError.withTraceId(String traceId) APM trace ID for tracing the request across microservicesA machine-readable representation of the type of error being returnedMethods in com.broadleafcommerce.common.error that return types with arguments of type ApiErrorModifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ApiError>ApiError.toResponseEntity() -
Uses of ApiError in com.broadleafcommerce.common.error.validation
Subclasses of ApiError in com.broadleafcommerce.common.error.validation -
Uses of ApiError in com.broadleafcommerce.common.error.validation.web
Methods in com.broadleafcommerce.common.error.validation.web with type parameters of type ApiErrorModifier and TypeMethodDescription<A extends ApiError>
org.springframework.http.ResponseEntity<A>ExceptionHandlerUtils.buildResponseEntityAndLogException(BiFunction<String, org.springframework.http.HttpStatus, A> errorFactory, String title, org.springframework.http.HttpStatus clientStatus, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log) Integrates, sanitizes, and logs an already constructed custom ApiError subclass using a functional factory with central log correlation and tracing.<A extends ApiError>
org.springframework.http.ResponseEntity<A>ExceptionHandlerUtils.buildResponseEntityAndLogException(BiFunction<String, org.springframework.http.HttpStatus, A> errorFactory, String title, org.springframework.http.HttpStatus clientStatus, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log, org.slf4j.event.Level logLevelOverride) Integrates, sanitizes, and logs an already constructed custom ApiError subclass using a functional factory with central log correlation and tracing.protected <A extends ApiError>
org.springframework.http.ResponseEntity<A>ExceptionHandlerUtils.processAndLogException(BiFunction<String, org.springframework.http.HttpStatus, A> errorFactory, String type, String title, org.springframework.http.HttpStatus clientStatus, org.springframework.http.HttpStatus downstreamStatus, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log, org.slf4j.event.Level logLevelOverride) Core consolidated implementation of exception logging, sanitization, and correlation.Methods in com.broadleafcommerce.common.error.validation.web that return types with arguments of type ApiErrorModifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ApiError>ExceptionHandlerUtils.buildResponseEntityAndLogException(String type, String title, org.springframework.http.HttpStatus status, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log) Builds a sanitized ApiError and logs the detailed exception internally with log correlation IDs.org.springframework.http.ResponseEntity<ApiError>ExceptionHandlerUtils.buildResponseEntityAndLogException(String type, String title, org.springframework.http.HttpStatus clientStatus, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log, org.slf4j.event.Level logLevelOverride) Builds a sanitized ApiError and logs the detailed exception internally with log correlation IDs.org.springframework.http.ResponseEntity<ApiError>ExceptionHandlerUtils.buildResponseEntityAndLogException(String type, String title, org.springframework.http.HttpStatus clientStatus, org.springframework.http.HttpStatus downstreamStatus, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log) Builds a sanitized ApiError and logs the detailed exception internally with log correlation IDs.org.springframework.http.ResponseEntity<ApiError>ExceptionHandlerUtils.buildResponseEntityAndLogException(String type, String title, org.springframework.http.HttpStatus clientStatus, org.springframework.http.HttpStatus downstreamStatus, Throwable ex, org.springframework.web.context.request.WebRequest request, org.slf4j.Logger log, org.slf4j.event.Level logLevelOverride) Builds a sanitized ApiError and logs the detailed exception internally with log correlation IDs.org.springframework.http.ResponseEntity<ApiError>IllegalArgumentExceptionAdvisor.handleIllegalArgumentException(IllegalArgumentException ex, org.springframework.web.context.request.WebRequest request) Handles uncaught illegal argument exceptions by logging them and returning anApiErrorwith 400 status.org.springframework.http.ResponseEntity<ApiError>RuntimeExceptionAdvisor.handleRuntimeException(RuntimeException ex, org.springframework.web.context.request.WebRequest request) Handles uncaught runtime exceptions by logging them and returning anApiError.