public class NuxeoException extends RuntimeException
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; }
Modifier and Type | Field and Description |
---|---|
protected int |
statusCode |
Constructor and 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) |
Modifier and Type | Method and Description |
---|---|
void |
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.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected int statusCode
public NuxeoException()
public NuxeoException(int statusCode)
public NuxeoException(String message)
public NuxeoException(String message, int statusCode)
public NuxeoException(String message, Throwable cause)
public NuxeoException(String message, Throwable cause, int statusCode)
public NuxeoException(Throwable cause)
public NuxeoException(Throwable cause, int statusCode)
public void addInfo(String info)
info
- the informationpublic List<String> getInfos()
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.
public String getOriginalMessage()
public String getMessage()
getMessage
in class Throwable
public int getStatusCode()
Copyright © 2018 Nuxeo. All rights reserved.