java.lang.Object
com.genologics.ri.exception.Exception
- All Implemented Interfaces:
Serializable
Exception is a descriptive error message that is returned instead of the
standard response for any request that the system was unable to process.
Exception will include a code corresponding to the HTTP response code of the error. Typical response codes are 400, indicating that the submitted request was not valid and cannot be reattempted without corrective action being taken, or 500 indicating that there was an internal error in the server when attempting to process the request. Refer to the section on HTTP response codes in the API reference documentation for further details about the categories and meanings of HTTP response codes.
Exception will include a message element with a textual summary of the error, and may also provide a suggested-actions element with details on how to correct the problem.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe category of the exception.protected StringThe HTTP response code corresponding to the error (e.g., 400 for bad request, 500 for internal server error).protected StringA textual summary of the error that occurred.protected StringDetails on how to correct the problem that caused the exception. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the category of the exception.getCode()Gets the HTTP response code of the error.Gets the error message.Gets the suggested actions to correct the error.voidsetCategory(String category) Sets the category of the exception.voidSets the HTTP response code of the error.voidsetMessage(String message) Sets the error message.voidsetSuggestedActions(String suggestedActions) Sets the suggested actions to correct the error.
-
Field Details
-
message
A textual summary of the error that occurred. -
suggestedActions
Details on how to correct the problem that caused the exception. -
category
The category of the exception. -
code
The HTTP response code corresponding to the error (e.g., 400 for bad request, 500 for internal server error).
-
-
Constructor Details
-
Exception
public Exception()Creates a new Exception instance.
-
-
Method Details
-
getMessage
Gets the error message.- Returns:
- The textual summary of the error.
-
setMessage
Sets the error message.- Parameters:
message- The textual summary of the error to set.
-
getSuggestedActions
Gets the suggested actions to correct the error.- Returns:
- Details on how to correct the problem, or null if not provided.
-
setSuggestedActions
Sets the suggested actions to correct the error.- Parameters:
suggestedActions- Details on how to correct the problem.
-
getCategory
Gets the category of the exception.- Returns:
- The exception category.
-
setCategory
Sets the category of the exception.- Parameters:
category- The exception category to set.
-
getCode
Gets the HTTP response code of the error.- Returns:
- The HTTP response code (e.g., "400", "500").
-
setCode
Sets the HTTP response code of the error.- Parameters:
code- The HTTP response code to set.
-