Class AppianException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.appiancorp.suiteapi.common.exceptions.AppianException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ActionNotFoundException
,AppianException
,AppianStorageException
,ApplicationNotFoundException
,Controller.ControllerException
,DuplicateExpressionException
,DuplicateIdException
,DuplicateNameException
,DuplicateUuidException
,InvalidActionException
,InvalidActivityClassSchemaException
,InvalidApplicationException
,InvalidCalendarException
,InvalidDecimalException
,InvalidNavigationItemException
,InvalidStatusException
,LocalizedAppianRuntimeException.LocalizedAppianException
,ObjectNotFoundException
,RenameNotAllowedException
,ResultPageSizeException
,RetryableAppianException
,SelfRenameException
,ServiceLocatorException
,SmartServiceException
,UnavailableApplicationException
,UpgradeException
AppianException
is the base class of all application-level
exceptions thrown in the product. Application-level
exceptions are intended to be caught and handled locally by one of the
callers that is capable of taking the appropriate action (such as retrying,
performing alternative operations, notifying the user, showing a local
message on the user interface, etc.) AppianException takes care of properly
formatting and internationalizing the exception messages by associating the
exception with an error code. Subclasses should override the getErrorCode and
getErrorCodeArguments methods to map the appropriate message to the
exception.- See Also:
-
Constructor Summary
ConstructorDescriptionDeprecated.AppianException
(ErrorCode errorCode, Object... errorCodeArgs) AppianException
(ErrorCode errorCode, Throwable cause) AppianException
(ErrorCode errorCode, Throwable cause, Object... errorCodeArgs) AppianException
(String message) Deprecated.this constructor will be removed in future releases, as all exception messages must be associated via an error code.AppianException
(String message, Throwable cause) Deprecated.this constructor will be removed in future releases, as all exception messages must be associated via an error code.AppianException
(Throwable cause) Constructs a newAppianException
as a wrapper around theThrowable
passed in with a detail message of(cause==null ?
-
Method Summary
Modifier and TypeMethodDescriptionGets the error code associated with this exception.protected Object[]
Gets the arguments that must be used to render this exception's message representation.protected Object[]
getErrorCodeArguments
(Locale locale) Gets the arguments that must be used to render this exception's message and title representation.final String[]
Returns the arguments (converted to Strings) of the error code tied to this exception.The default implementation is equivalent to callinggetLocalizedMessage(Locale)
withLocale.US
as argument.getLocalizedMessage
(Locale locale) Returns this exception's message representation.Returns this exception's default message representation with error code information.getLocalizedTitle
(Locale locale) Returns this exception's title representation.The default implementation is equivalent to callinggetLocalizedMessage()
toString()
Returns a detailed exception's message representation.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
AppianException
-
AppianException
-
AppianException
-
AppianException
Deprecated.Constructs a newAppianException
with an empty string as its detail message. -
AppianException
Deprecated.this constructor will be removed in future releases, as all exception messages must be associated via an error code. -
AppianException
Constructs a newAppianException
as a wrapper around theThrowable
passed in with a detail message of(cause==null ? "" : cause.toString())
.- Parameters:
cause
- the cause, or theThrowable
that caused thisAppianException
to get thrown
-
AppianException
Deprecated.this constructor will be removed in future releases, as all exception messages must be associated via an error code.
-
-
Method Details
-
getErrorCode
Gets the error code associated with this exception. Subclasses should override this method to return specific error codes. The default implementation returns APNX-1-0000-000 (ErrorCode.GENERIC_ERROR).- See Also:
-
getErrorCodeArguments
Gets the arguments that must be used to render this exception's message representation. Subclasses should override this method to return specific arguments. The default implementation returns a length 1 array containing the message as returned by the parent class of AppianException. This method is only called whengetErrorCodeArguments(Locale)
hasn't been overwritten.- Returns:
- the arguments of the error code tied to this exception
- See Also:
-
getErrorCodeArgumentsAsStringArray
Returns the arguments (converted to Strings) of the error code tied to this exception. Returns an empty array if there are no arguments.- Parameters:
locale
- The locale to use for retrieving the arguments.
-
getErrorCodeArguments
Gets the arguments that must be used to render this exception's message and title representation. Subclasses should override this method to return specific locale-sensitive arguments. The default implementation callsgetErrorCodeArguments()
.- Parameters:
locale
- arguments' locale- Returns:
- the arguments of the error code tied to this exception
-
getMessage
The default implementation is equivalent to callinggetLocalizedMessage()
- Overrides:
getMessage
in classThrowable
-
getLocalizedMessage
The default implementation is equivalent to callinggetLocalizedMessage(Locale)
withLocale.US
as argument. Please note that the error message filtering logic in https://issues.appian.com/browse/AN-274235 depends on this default behavior. Please contact Portals Foundations before changing this default behavior.- Overrides:
getLocalizedMessage
in classThrowable
-
getLocalizedMessage
Returns this exception's message representation. This method should be used whenever the message is to be displayed to the end user. The default representation does not include any error code information because this may be rendered in different ways across the application. If needed, the exception's error code can be retrieved fromgetErrorCode()
.- Parameters:
locale
- message's locale- Returns:
- this exception's message representation
- See Also:
-
getLocalizedTitle
Returns this exception's title representation. This method should be used whenever the title is to be displayed to the end user. The default representation does not include any error code information because this may be rendered in different ways across the application. If needed, the exception's error code can be retrieved fromgetErrorCode()
.- Parameters:
locale
- title's locale- Returns:
- this exception's title representation
- See Also:
-
getLocalizedMessageWithErrorCode
Returns this exception's default message representation with error code information. This method could be used whenever the message is to be displayed to the end user. Although the default representationgetLocalizedMessage(Locale)
does not include any error code information, as the representation could vary in different ways across the application, this method provides a utility for a representation with error code. If the error code isnull
orErrorCode.GENERIC_ERROR
, no error code information is included. Be sure while using this method as the requirements could vary, in which case usegetLocalizedMessage(Locale)
in conjunction withgetErrorCode()
.- Parameters:
locale
- message's locale- Returns:
- this exception's default message representation with error code
- See Also:
-
toString
Returns a detailed exception's message representation. This method should not be used to display messages to the end user. The default representation includes the exception class name, the exception's message as returned bygetMessage()
and the error code associated with this exception. If the error code isErrorCode.GENERIC_ERROR
, no error code information is included.
-