Class FailureItemException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.opengamma.strata.collect.result.FailureItemException
-
- All Implemented Interfaces:
FailureItemProvider
,Serializable
public class FailureItemException extends RuntimeException implements FailureItemProvider
An exception thrown when an exception can be represented by aFailureItem
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FailureItemException(FailureItem item)
Returns an exception wrapping the failure item.FailureItemException(FailureReason reason, String messageTemplate, Object... messageArgs)
Returns an exception from a reason and message.FailureItemException(FailureReason reason, Throwable cause, String messageTemplate, Object... messageArgs)
Returns an exception from a reason, cause and message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FailureItem
getFailureItem()
Gets the failure item.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
FailureItemException
public FailureItemException(FailureItem item)
Returns an exception wrapping the failure item.- Parameters:
item
- the failure item
-
FailureItemException
public FailureItemException(FailureReason reason, String messageTemplate, Object... messageArgs)
Returns an exception from a reason and message.The message is produced using a template that contains zero to many "{argName}" placeholders. Each placeholder is replaced by the next available argument. If there are too few arguments, then the message will be left with placeholders. If there are too many arguments, then the excess arguments are appended to the end of the message. No attempt is made to format the arguments. See
Messages.formatWithAttributes(String, Object...)
for more details.- Parameters:
reason
- the reasonmessageTemplate
- a message explaining the failure, not empty, uses "{argName}" for insertingmessageArgs
messageArgs
- the arguments for the message
-
FailureItemException
public FailureItemException(FailureReason reason, Throwable cause, String messageTemplate, Object... messageArgs)
Returns an exception from a reason, cause and message.The message is produced using a template that contains zero to many "{argName}" placeholders. Each placeholder is replaced by the next available argument. If there are too few arguments, then the message will be left with placeholders. If there are too many arguments, then the excess arguments are appended to the end of the message. No attempt is made to format the arguments. See
Messages.formatWithAttributes(String, Object...)
for more details.- Parameters:
reason
- the reasoncause
- the causemessageTemplate
- a message explaining the failure, not empty, uses "{argName}" for insertingmessageArgs
messageArgs
- the arguments for the message
-
-
Method Detail
-
getFailureItem
public FailureItem getFailureItem()
Gets the failure item.- Specified by:
getFailureItem
in interfaceFailureItemProvider
- Returns:
- the failure item
-
-