java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.cloudevents.rw.CloudEventRWException
- All Implemented Interfaces:
Serializable
This class is the exception Protocol Binding and Event Format implementers can use to signal errors while serializing/deserializing CloudEvent.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe kind of error that happened while serializing/deserializing -
Method Summary
Modifier and TypeMethodDescriptiongetKind()static CloudEventRWExceptionnewDataConversion(Throwable cause, String from, String to) static CloudEventRWExceptionnewInvalidAttributeName(String attributeName) static CloudEventRWExceptionnewInvalidAttributeType(String attributeName, Class<?> clazz) static CloudEventRWExceptionnewInvalidAttributeType(String attributeName, Object value) static CloudEventRWExceptionnewInvalidAttributeValue(String attributeName, Object value, Throwable cause) static CloudEventRWExceptionnewInvalidDataType(String actual, String... allowed) static CloudEventRWExceptionnewInvalidExtensionName(String extensionName) static CloudEventRWExceptionnewInvalidSpecVersion(String specVersion) static CloudEventRWExceptionAn exception for use where none of the other variants are appropriate.static CloudEventRWExceptionThis wraps aThrowablein a new generic instance of this exception.static CloudEventRWExceptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
getKind
- Returns:
- the
CloudEventRWException.CloudEventRWExceptionKindassociated to this exception instance.
-
newInvalidSpecVersion
- Parameters:
specVersion- the invalid input spec version- Returns:
- a new
CloudEventRWExceptioninstance
-
newInvalidAttributeName
- Parameters:
attributeName- the invalid attribute name- Returns:
- a new
CloudEventRWExceptioninstance
-
newInvalidExtensionName
- Parameters:
extensionName- the invalid extension name- Returns:
- a new
CloudEventRWExceptioninstance
-
newInvalidAttributeType
- Parameters:
attributeName- the invalid attribute nameclazz- the type of the attribute- Returns:
- a new
CloudEventRWExceptioninstance
-
newInvalidAttributeType
-
newInvalidAttributeValue
public static CloudEventRWException newInvalidAttributeValue(String attributeName, Object value, @Nullable Throwable cause) - Parameters:
attributeName- the invalid attribute namevalue- the value of the attributecause- an optional cause identifying the eventual validation error- Returns:
- a new
CloudEventRWExceptioninstance
-
newInvalidDataType
- Parameters:
actual- the actual data typeallowed- the list of allowed data types- Returns:
- a new
CloudEventRWExceptioninstance
-
newDataConversion
- Parameters:
cause- the cause of the conversion failurefrom- the input data typeto- the target data type- Returns:
- a new
CloudEventRWExceptioninstance
-
newUnknownEncodingException
- Returns:
- a new
CloudEventRWExceptioninstance.
-
newOther
This wraps aThrowablein a new generic instance of this exception.- Parameters:
cause- the cause of the exception- Returns:
- a new
CloudEventRWExceptioninstance
-
newOther
An exception for use where none of the other variants are appropriate.- Parameters:
msg- A description error message.- Returns:
- a new
CloudEventRWException
-