Class SerializableErrorEntity
java.lang.Object
org.gcube.common.gxrest.response.entity.SerializableErrorEntity
An entity that can be serialized in a
WebCodeException.- Author:
- Manuele Simi (ISTI CNR), Luca Frosini (ISTI-CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final charThe separator for the entity fields. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new serializable error entity.SerializableErrorEntity(Exception e, int lines) SerializableErrorEntity(ErrorCode errorCode) -
Method Summary
Modifier and TypeMethodDescriptionintgetId()Gets the id of the error.Gets the message of the error.booleanChecks if a stacktrace is available.protected voidsetEncodedTrace(String encodedTrace) Sets the enconded trace.protected voidsetExceptionClass(String exceptionClass) Sets the exception class.protected voidsetMessage(String message) Sets the message.
-
Field Details
-
ENTITY_CHAR_SEPARATOR
protected static final char ENTITY_CHAR_SEPARATORThe separator for the entity fields.- See Also:
-
-
Constructor Details
-
SerializableErrorEntity
public SerializableErrorEntity()Creates a new serializable error entity. -
SerializableErrorEntity
- Parameters:
errorCode- the errorc code to serialize
-
SerializableErrorEntity
- Parameters:
e- the exception to serialize
-
SerializableErrorEntity
- Parameters:
e- the exception to serializelines- the number of lines in the stacktrace to serialize
-
-
Method Details
-
getId
public int getId()Gets the id of the error.- Returns:
- the id
-
getMessage
Gets the message of the error.- Returns:
- the message
-
getExceptionClass
- Returns:
- the full qualified name of the embedded
Exception
-
getEncodedTrace
- Returns:
- the encoded stacktrace
-
hasStackTrace
public boolean hasStackTrace()Checks if a stacktrace is available.- Returns:
- true if a stacktrace is serialized in the entity.
-
setMessage
Sets the message.- Parameters:
message- the message
-
setExceptionClass
Sets the exception class.- Parameters:
exceptionClass- the exception class
-
setEncodedTrace
Sets the enconded trace.- Parameters:
encodedTrace- the encoded trace
-