public class BpmError extends IvyRuntimeException
Provides information about an error that occured in the process.
Use BpmError.create(String)
to create or throw a new BpmError
.
Modifier and Type | Class and Description |
---|---|
static class |
BpmError.AttributeNames
Defines names of attributes that are available on errors with certain error codes
|
Modifier and Type | Method and Description |
---|---|
static BpmPublicErrorBuilder |
create(BpmError errorCause)
To create a new
error with the given errorCause |
static BpmPublicErrorBuilder |
create(String errorCode)
To create a new
error with the given errorCode |
Object |
getAttribute(String name)
Error attributes can be used to provide more information about the error.
The attributes can be use to format the default error message and error messages . |
Set<String> |
getAttributeNames()
Error attributes can be used to provide more information about the error.
The attributes can be use to format the default error message and error messages . |
Throwable |
getCause()
Returns the cause of this error.
|
BpmError |
getErrorCause()
Returns the error cause of the error.
|
String |
getErrorCode()
The error code is used to identify different kind of business errors.
|
String |
getErrorMessage()
Returns the error message of this error.
|
String |
getErrorMessage(String messageName)
Returns the specific message with the given
messageName of this error. |
String |
getId()
A unique error id.
|
String |
getMessage()
Returns the message of this error.
|
List<BpmStackFrame> |
getProcessCallStack()
The process call stack at the moment the error was thrown.
The process call stack is empty if the error was thrown in a top level process. |
BpmProcessElement |
getProcessElement()
The process element that threw (caused) the error.
|
Throwable |
getTechnicalCause()
Returns the technical cause of the error.
|
void |
setAttribute(String name,
Object value)
Error attributes can be used to add more information about the error.
The attributes can be use to format the default error message and error messages . |
public static BpmPublicErrorBuilder create(String errorCode)
error
with the given errorCode
Examples:
BpmError.create("finance:nomoney").build()
BpmError.create("finance:nomoney").withMessage("There is no money left").build()
errorCode
- BpmError.create(BpmError)
,
BpmError.getErrorCode()
public static BpmPublicErrorBuilder create(BpmError errorCause)
error
with the given errorCause
Examples:
BpmError errorCause = in.error;
BpmError.create(errorCause).build();
BpmError errorCause = in.error;
BpmError.create(errorCause).withErrorCode("finance:nomoney").withMessage("There is no money left").build();
errorCause
- BpmError.create(String)
,
BpmError.getErrorCause()
,
BpmErrorBuilder.withErrorCode(String)
public String getId()
getId
in class IvyRuntimeException
public String getErrorCode()
BpmErrorBuilder.withErrorCode(String)
public Throwable getTechnicalCause()
BpmError.getErrorCause()
,
BpmError.getCause()
,
BpmErrorBuilder.withCause(Throwable)
public BpmError getErrorCause()
BpmError.getTechnicalCause()
,
BpmError.getCause()
,
BpmErrorBuilder.withCause(Throwable)
public Throwable getCause()
Returns the cause of this error.
This is either the BpmError.getErrorCause()
or the BpmError.getTechnicalCause()
or null.
getCause
in class Throwable
Throwable.getCause()
,
BpmError.getErrorCause()
,
BpmError.getTechnicalCause()
public void setAttribute(String name, Object value)
default error message
and error messages
.name
- value
- BpmError.getAttribute(String)
,
BpmError.getMessage()
,
BpmError.getErrorMessage()
,
BpmError.getErrorMessage(String)
,
BpmErrorBuilder.withAttribute(Object)
,
BpmErrorBuilder.withAttribute(String, Object)
,
BpmErrorBuilder.withAttributes(Map)
public Object getAttribute(String name)
Error attributes can be used to provide more information about the error.
The attributes can be use to format the default error message
and error messages
.
See BpmError.AttributeNames
for attributes that are available on errors provided by the system.
name
- BpmError.setAttribute(String, Object)
,
BpmError.getMessage()
,
BpmError.getErrorMessage()
,
BpmError.getErrorMessage(String)
,
BpmErrorBuilder.withAttribute(Object)
,
BpmErrorBuilder.withAttribute(String, Object)
,
BpmErrorBuilder.withAttributes(Map)
,
BpmError.AttributeNames
public Set<String> getAttributeNames()
Error attributes can be used to provide more information about the error.
The attributes can be use to format the default error message
and error messages
.
See BpmError.AttributeNames
for attributes that are available on errors provided by the system.
BpmError.setAttribute(String, Object)
,
BpmError.getAttribute(String)
,
BpmErrorBuilder.withAttribute(Object)
,
BpmErrorBuilder.withAttribute(String, Object)
,
BpmErrorBuilder.withAttributes(Map)
,
BpmError.AttributeNames
public String getMessage()
Returns the message of this error.
Use BpmError.getErrorMessage()
to get a localized message for the end user.
The message can be given when creating the error (see BpmErrorBuilder.withMessage(String)
)
if not specified it is the BpmError.getErrorCode()
.
Any attribute placeholder ({0}, {1}, etc) in the message are replaced with the corresponding attributes
.
getMessage
in class Throwable
BpmErrorBuilder.withMessage(String)
,
BpmError.getErrorMessage()
,
BpmError.getErrorMessage(String)
,
BpmErrorBuilder.withMessage(String)
,
BpmErrorBuilder.withCause(Throwable)
,
BpmError.setAttribute(String, Object)
,
BpmError.getAttribute(String)
,
BpmErrorBuilder.withAttribute(Object)
,
BpmErrorBuilder.withAttribute(String, Object)
public String getErrorMessage()
Returns the error message of this error.
The error message is intended to be displayed to the end user. Therefore the error message for an error is normally stored in the CMS so that it can be translated to different languages.
For an error with the error code ivy:error:database
the error message is searched in the CMS in the following order and paths:
/Errors/ivy/error/database/message
/Errors/ivy/error/database
/Errors/ivy/error/message
/Errors/ivy/error
/Errors/ivy/message
/Errors/ivy
errorCode
and if available the message of the technical cause
is returned instead.
Any attribute placeholder ({0}, {1}, etc) in the message are replaced with the corresponding attributes
.
BpmError.getMessage()
,
BpmError.getErrorMessage(String)
,
BpmError.setAttribute(String, Object)
,
BpmError.getAttribute(String)
,
BpmErrorBuilder.withAttribute(Object)
,
*
public String getErrorMessage(String messageName)
Returns the specific message with the given messageName
of this error. For example a help
or a how to proceed
text.
The specific message is intended to be displayed to the end user. Therefore specific messages for an error is normally stored in the CMS so that it can be translated to different languages.
For an error with the error code ivy:error:database
and the messageName
help
the error message is searched in the CMS in the following order and paths:
/Errors/ivy/error/database/help
/Errors/ivy/error/help
/Errors/ivy/help
Any attribute placeholder ({0}, {1}, etc) in the message are replaced with the corresponding attributes
.
messageName
- the name of the message to returnmessageName
BpmError.getMessage()
,
BpmError.getErrorMessage()
,
BpmError.setAttribute(String, Object)
,
BpmError.getAttribute(String)
,
BpmErrorBuilder.withAttribute(Object)
,
BpmErrorBuilder.withAttribute(String, Object)
public BpmProcessElement getProcessElement()
public List<BpmStackFrame> getProcessCallStack()
Copyright © 2024
AXON IVY AG
All Rights Reserved Documentation was generated
on April 28, 2024