public class AppianErrorBuilder
extends java.lang.Object
AppianError
objects using Appian error codes.Constructor and Description |
---|
AppianErrorBuilder(AppianErrorCodeFormatter formatter,
ErrorCode code,
java.lang.Object... args) |
AppianErrorBuilder(ErrorCode code,
java.lang.String message) |
AppianErrorBuilder(ErrorCode code,
java.lang.String message,
java.lang.String title) |
AppianErrorBuilder(java.util.Locale targetLocale,
ErrorCode code,
java.lang.Object... args) |
Modifier and Type | Method and Description |
---|---|
AppianError |
build() |
static com.google.common.base.Function<java.lang.Throwable,AppianError> |
fromThrowable(java.util.Locale targetLocale)
Returns a function to create
AppianError s from exceptions. |
static AppianError |
fromThrowable(java.util.Locale targetLocale,
java.lang.Throwable t)
Creates an
AppianError from the given exception, by applying the function
generated by fromThrowable(Locale) . |
static AppianError |
fromThrowable(java.util.Locale targetLocale,
java.lang.Throwable t,
ErrorCode defaultError)
Creates an
AppianError from the given exception, by applying the function
generated by fromThrowable(Locale) . |
AppianErrorBuilder |
setCause(AppianErrorBuilder causeBuilder) |
AppianErrorBuilder |
setDetails(java.lang.String details) |
AppianErrorBuilder |
setTitle(java.lang.String title) |
public AppianErrorBuilder(java.util.Locale targetLocale, ErrorCode code, java.lang.Object... args)
public AppianErrorBuilder(AppianErrorCodeFormatter formatter, ErrorCode code, java.lang.Object... args)
public AppianErrorBuilder(ErrorCode code, java.lang.String message)
public AppianErrorBuilder(ErrorCode code, java.lang.String message, java.lang.String title)
public AppianErrorBuilder setTitle(java.lang.String title)
public AppianErrorBuilder setDetails(java.lang.String details)
public AppianErrorBuilder setCause(AppianErrorBuilder causeBuilder)
public AppianError build()
public static final AppianError fromThrowable(java.util.Locale targetLocale, java.lang.Throwable t, ErrorCode defaultError)
AppianError
from the given exception, by applying the function
generated by fromThrowable(Locale)
. Uses the supplied default error code
for any exceptions that are do not supply their own codes
(AppianException
or AppianRuntimeException
)public static final AppianError fromThrowable(java.util.Locale targetLocale, java.lang.Throwable t)
AppianError
from the given exception, by applying the function
generated by fromThrowable(Locale)
.public static final com.google.common.base.Function<java.lang.Throwable,AppianError> fromThrowable(java.util.Locale targetLocale)
AppianError
s from exceptions. This function will
traverse the cause exceptions of any given exception. For non-Appian exceptions, the
error code ErrorCode.GENERIC_RUNTIME_ERROR
is used, and the exception class
name and message are placed in the details
of the
error bean. For Appian exceptions (any AppianException
or
AppianRuntimeException
), the localized message is retrieved using the given
locale.Copyright © 2003-2024 Appian Corporation. All Rights Reserved.