Package com.emc.documentum.rest.error
Class RestErrorBuilder
java.lang.Object
com.emc.documentum.rest.error.RestErrorBuilder
A builder to build the REST error from a generic exception.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSet the message arguments for the corresponding message of the REST error codebuild()
Build the REST error with localeSet the REST error codeSet the details for the REST error.Set id for the REST errorSet the localization for error message.status
(int status) Set the HTTP status code
-
Constructor Details
-
RestErrorBuilder
Constructor- Parameters:
throwable
- exception during the operation
-
-
Method Details
-
status
Set the HTTP status code- Parameters:
status
- the HTTP status code for error response- Returns:
- the builder itself
-
code
Set the REST error code- Parameters:
code
- the REST error code- Returns:
- the builder itself
-
args
Set the message arguments for the corresponding message of the REST error code- Parameters:
args
- the message arguments- Returns:
- the builder itself
-
details
Set the details for the REST error. Details will be delimited by semicolon(;).- Parameters:
details
- the details of the REST error.- Returns:
- the builder itself
-
id
Set id for the REST error- Parameters:
id
- the REST error message id- Returns:
- this builder itself
-
locale
Set the localization for error message. The default locale will be got from RepositoryContextHolder or the OS default locale.- Parameters:
locale
- the locale for the error message- Returns:
- this builder itself
-
build
Build the REST error with locale- Returns:
- the REST error instance
-