@Override protected boolean matchesSafely( Status item ) { return item.isClientError(); }
@Override protected boolean matchesSafely(Status item) { return item.isClientError(); }
public boolean isClientError() { return status.isClientError(); }
/** * Indicates if the status is a client error status, meaning "The request * contains bad syntax or cannot be fulfilled". * * @return True if the status is a client error status. */ public boolean isClientError() { return isClientError(getCode()); }
/** * Indicates if the status is a client error status, meaning "The request * contains bad syntax or cannot be fulfilled". * * @return True if the status is a client error status. */ public boolean isClientError() { return isClientError(getCode()); }
/** * Indicates if the status is a client error status, meaning "The request * contains bad syntax or cannot be fulfilled". * * @return True if the status is a client error status. */ public boolean isClientError() { return isClientError(getCode()); }
/** * Indicates if the status is an error (client or server) status. * * @param code * The code of the status. * @return True if the status is an error (client or server) status. */ public static boolean isError(int code) { return isClientError(code) || isServerError(code) || isConnectorError(code); }
/** * Indicates if the status is an error (client or server) status. * * @param code * The code of the status. * @return True if the status is an error (client or server) status. */ public static boolean isError(int code) { return isClientError(code) || isServerError(code) || isConnectorError(code); }
/** * Indicates if the status is an error (client or server) status. * * @param code * The code of the status. * @return True if the status is an error (client or server) status. */ public static boolean isError(int code) { return isClientError(code) || isServerError(code) || isConnectorError(code) || isGlobalError(code); }
/** * Indicates if the application and all its resources can be described using * WADL. * * @param remainingPart * The URI remaining part. * @param request * The request to handle. * @param response * The response to update. */ protected boolean canDescribe(String remainingPart, Request request, Response response) { return isAutoDescribing() && Method.OPTIONS.equals(request.getMethod()) && (response.getStatus().isClientError() || !response .isEntityAvailable()) && ("/".equals(remainingPart) || "".equals(remainingPart)); }
} else if (status.isConnectorError()) { level = Level.INFO; } else if (status.isClientError()) { level = Level.FINE;
if (e.getStatus().isConnectorError()) { throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) { if (e.getStatus().getCode() == 403) { throw new RuntimeException("Restlet Cloud Authentication fails. Check that you provide valid credentials.", e);
if (e.getStatus().isConnectorError()) { throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) { if (e.getStatus().getCode() == 403) { throw new RuntimeException("Restlet Cloud Authentication fails. Check that you provide valid credentials.", e);
if (e.getStatus().isConnectorError()) { throw new RuntimeException("APISpark communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) { if (e.getStatus().getCode() == 403) { throw new RuntimeException("APISpark Authentication fails. Check that you provide valid credentials.", e);
if (e.getStatus().isConnectorError()) { throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) { if (e.getStatus().getCode() == 403) { throw new RuntimeException("Restlet Cloud Authentication fails. Check that you provide valid credentials.", e);
/** * Invoked when an error or an exception is caught during initialization, * handling or releasing. By default, updates the responses's status with * the result of {@link org.restlet.service.StatusService#toStatus(Throwable, Resource)}. * * @param throwable * The caught error or exception. */ protected void doCatch(Throwable throwable) { Level level = Level.INFO; Status status = getStatusService().toStatus(throwable, this); if (status.isServerError()) { level = Level.SEVERE; } else if (status.isConnectorError()) { level = Level.INFO; } else if (status.isClientError()) { level = Level.FINE; } getLogger().log(level, "Exception or error caught in server resource", throwable); if (getResponse() != null) { getResponse().setStatus(status); Representation errorEntity = getStatusService().toRepresentation( status, this); getResponse().setEntity(errorEntity); } }
if (e.getStatus().isConnectorError()) { throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) { if (e.getStatus().getCode() == 403) { throw new RuntimeException("Restlet Cloud Authentication fails. Check that you provide valid credentials.", e);