Interface ErrorContext
-
public interface ErrorContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceErrorContext.BuilderA builder for aErrorContext.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static ErrorContext.Builderbuilder(io.micronaut.http.HttpRequest<?> request)Create a new context builder.java.util.List<Error>getErrors()default java.util.Optional<java.lang.String>getExceptionMessage()Returns the exception message without adding it to the rendered errors.io.micronaut.http.HttpRequest<?>getRequest()java.util.Optional<java.lang.Throwable>getRootCause()default booleanhasErrors()
-
-
-
Method Detail
-
getRequest
@NonNull io.micronaut.http.HttpRequest<?> getRequest()
- Returns:
- The request that caused the error
-
getRootCause
@NonNull java.util.Optional<java.lang.Throwable> getRootCause()
- Returns:
- The optional root cause exception
-
getExceptionMessage
@NonNull default java.util.Optional<java.lang.String> getExceptionMessage()
Returns the exception message without adding it to the rendered errors.- Returns:
- The optional exception message
- Since:
- 3.10.11
-
getErrors
@NonNull java.util.List<Error> getErrors()
- Returns:
- The errors
-
hasErrors
default boolean hasErrors()
- Returns:
- True if there are errors present
-
builder
@NonNull static ErrorContext.Builder builder(@NonNull io.micronaut.http.HttpRequest<?> request)
Create a new context builder.- Parameters:
request- The request- Returns:
- A new context builder
-
-