Package org.nuxeo.ecm.core.api
Class NuxeoException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.nuxeo.ecm.core.api.NuxeoException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractBindingResolver.NoValueToAddInContext
,AbstractBindingResolver.ValueNotFound
,AuditQueryException
,BinaryMetadataException
,CommentNotFoundException
,CommentSecurityException
,ConcurrentUpdateException
,ConversionException
,DirectoryException
,DocumentExistsException
,DocumentNotFoundException
,DocumentRouteException
,DocumentSecurityException
,DocumentValidationException
,GroupAlreadyExistsException
,IllegalParameterException
,InvalidPasswordException
,InvalidSearchParameterException
,LifeCycleException
,LockException
,MarshallingException
,MaximumTransientSpaceExceeded
,MimetypeDetectionException
,MimetypeNotFoundException
,NuxeoDriveContribException
,PreviewException
,PropertyException
,QueryParseException
,RecoverableClientException
,RelationAlreadyExistsException
,RootlessItemException
,SignException
,TokenAuthenticationException
,TooManyChangesException
,UserAlreadyExistsException
,UserRegistrationException
,VersionNotModifiableException
,WebDeployException
,WebResourceNotFoundException
,WebSecurityException
,XMLTemplateSerializer.TemplateInputBadFormat
public class NuxeoException extends RuntimeException
The most generic exception thrown by the Nuxeo.It can be used to provide enriched information on the exception catch path, without re-wrapping:
try { doSomething(id); } catch (NuxeoException e) { e.addInfo("Failed to do something with document id: " + id); throw e; }
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
statusCode
-
Constructor Summary
Constructors Constructor Description NuxeoException()
NuxeoException(int statusCode)
NuxeoException(String message)
NuxeoException(String message, int statusCode)
NuxeoException(String message, Throwable cause)
NuxeoException(String message, Throwable cause, int statusCode)
NuxeoException(Throwable cause)
NuxeoException(Throwable cause, int statusCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NuxeoException
addInfo(String info)
Adds information to this exception, to be returned with the message.List<String>
getInfos()
Gets the information added to this exception.String
getMessage()
String
getOriginalMessage()
Gets the original message passed to the constructor, without additional information added.int
getStatusCode()
Gets the HTTP status code mapped to this exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
statusCode
protected int statusCode
-
-
Constructor Detail
-
NuxeoException
public NuxeoException()
-
NuxeoException
public NuxeoException(int statusCode)
- Since:
- 9.3
-
NuxeoException
public NuxeoException(String message)
-
NuxeoException
public NuxeoException(String message, int statusCode)
- Since:
- 9.3
-
NuxeoException
public NuxeoException(String message, Throwable cause)
-
NuxeoException
public NuxeoException(String message, Throwable cause, int statusCode)
- Since:
- 9.3
-
NuxeoException
public NuxeoException(Throwable cause)
-
NuxeoException
public NuxeoException(Throwable cause, int statusCode)
- Since:
- 9.3
-
-
Method Detail
-
addInfo
public NuxeoException addInfo(String info)
Adds information to this exception, to be returned with the message.- Parameters:
info
- the information- Since:
- 7.4
-
getInfos
public List<String> getInfos()
Gets the information added to this exception.The list is returned in the reverse order than that of the calls to
addInfo(java.lang.String)
, i.e., the last added information is first in the list.- Returns:
- the information list
- Since:
- 7.4
-
getOriginalMessage
public String getOriginalMessage()
Gets the original message passed to the constructor, without additional information added.- Since:
- 7.4
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
getStatusCode
public int getStatusCode()
Gets the HTTP status code mapped to this exception.- Since:
- 9.3
-
-