Package com.appiancorp.exceptions
Class AppianErrorCode
java.lang.Object
com.appiancorp.exceptions.AppianErrorCode
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ErrorCode,ValidationCode
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAppianErrorCode(String code) protectedAppianErrorCode(String code, boolean hasTitle) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintintgetMessage(AppianErrorCodeFormatter callback, Object... arguments) getMessageWithCode(AppianErrorCodeFormatter callback, Object... arguments) intReturns the .staticMessage field from the properties file if it exists or the error code text if it does not Note: this function does not take in arguments, and therefore will always return the same message for a given error codegetTitle(AppianErrorCodeTitleFormatter callback, Object... arguments) inthashCode()final booleanhasTitle()Indicates whether or not the given ErrorCode has a title corresponding to its message.static AppianErrorCodetoErrorCode(String code) Returns the error code.toString()
-
Constructor Details
-
AppianErrorCode
protected AppianErrorCode() -
AppianErrorCode
- Throws:
AppianErrorCode.InvalidErrorCode
-
AppianErrorCode
- Throws:
AppianErrorCode.InvalidErrorCode
-
-
Method Details
-
hasTitle
public final boolean hasTitle()Indicates whether or not the given ErrorCode has a title corresponding to its message.- Returns:
- true if the error code has a title
-
toErrorCode
Returns the error code. Will return null if the error code is not found. Codes should generally be referenced explicitly from a static member ofErrorCode. This is used currently in GWT and PMM Connected Environments so the server can send down the string code of an ErrorCode and an instance can be returned from the string code. See https://source.appian.com/cru/CR-AE-1752#CFR-23290- Parameters:
code- The string representation of an error code, example APNX-1-0000-000- Returns:
- An
AppianErrorCode
-
getNamespace
public int getNamespace() -
getCategory
public int getCategory() -
getDetail
public int getDetail() -
equals
-
hashCode
public int hashCode() -
toString
-
getMessage
-
getTitle
-
getMessageWithCode
-
getStaticMessage
Returns the .staticMessage field from the properties file if it exists or the error code text if it does not Note: this function does not take in arguments, and therefore will always return the same message for a given error code- Parameters:
callback- formatter to get the static message- Returns:
- static message for an error code
-