@Override
public Status getStatus(Throwable throwable, Request request, Response response) {
if (throwable instanceof ErrorInfoException) {
ErrorInfo errInfo = ((ErrorInfoException)throwable).getErrorInfo();
response.setEntity(new StringRepresentation(errInfo.toString(), TEXT_PLAIN, Language.ALL, UTF_8));
return new Status(CLIENT_ERROR_BAD_REQUEST, errInfo.getErrorType().getLabel());
}
else {
return super.getStatus(throwable, request, response);
}