public class ErrorSummary extends SerializableUWSObject
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
details
[Optional] The URI/URL toward the file which contains a more detailed description of the error (i.e.
|
protected java.lang.String |
message
[Required] A short description of the error.
|
protected ErrorType |
type
[Required] The type of the error.
|
Constructor and Description |
---|
ErrorSummary(java.lang.Exception ex,
ErrorType errorType,
java.lang.String detailedMsgURI)
Builds an error summary from an Exception.
|
ErrorSummary(java.lang.String msg,
ErrorType errorType)
Builds an error summary with the given short description.
|
ErrorSummary(java.lang.String msg,
ErrorType errorType,
java.lang.String detailedMsgURI)
Builds an error summary with the given short description and with the URL to access to a detailed description.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDetails()
Gets the URI/URL where the details about the occurred error can be found.
|
java.lang.String |
getMessage()
Gets a short description of the occurred error.
|
ErrorType |
getType()
Gets the type of the occurred error (
ErrorType.FATAL by default). |
boolean |
hasDetail()
Indicates whether there are more details about the occurred error.
If true these details can be found at {jobs}/(job-id)/error. |
java.lang.String |
serialize(UWSSerializer serializer,
JobOwner owner)
Serializes the whole object considering the given owner (supposed to be the current user)
and thanks to the given serializer.
|
java.lang.String |
toString() |
serialize, serialize, serialize
protected java.lang.String message
protected ErrorType type
protected java.lang.String details
public ErrorSummary(java.lang.Exception ex, ErrorType errorType, java.lang.String detailedMsgURI)
Builds an error summary from an Exception.
WARNING: No file is written: that is the responsibility of the creator of this error summary !
ex
- The Exception which describes the error. Only the message is used (Throwable.getMessage()
).errorType
- The type of this error. (if null the error type is by default set to ErrorType.FATAL
)detailedMsgURI
- null or the URI/URL at which a detailed error message is given (different from {jobs}/(job-id)/error).ErrorSummary(String, ErrorType, String)
public ErrorSummary(java.lang.String msg, ErrorType errorType)
msg
- A short description of the error.errorType
- The type of the error. (if null the error type is by default set to ErrorType.FATAL
)ErrorSummary(String, ErrorType, String)
public ErrorSummary(java.lang.String msg, ErrorType errorType, java.lang.String detailedMsgURI)
Builds an error summary with the given short description and with the URL to access to a detailed description.
Warning: No file is written: that is the responsibility of the creator of this error summary !
msg
- A short description of the error.errorType
- The type of the error. (if null the error type is by default set to ErrorType.FATAL
)detailedMsgURI
- null or the URI/URL at which a detailed error message is given (different from {jobs}/(job-id)/error).public final java.lang.String getMessage()
public final ErrorType getType()
ErrorType.FATAL
by default).ErrorType
public final boolean hasDetail()
public final java.lang.String getDetails()
public java.lang.String serialize(UWSSerializer serializer, JobOwner owner) throws UWSException, java.lang.Exception
SerializableUWSObject
serialize
in class SerializableUWSObject
serializer
- The serializer to use.owner
- The current user.UWSException
- If the owner is not allowed to see the content of the serializable object.java.lang.Exception
- If there is any other error during the serialization.public java.lang.String toString()
toString
in class java.lang.Object