/** * Indicates if the status is a connector error status, meaning "The * connector failed to send or receive an apparently valid message". * * @return True if the status is a connector error status. */ public boolean isConnectorError() { return isConnectorError(getCode()); }
/** * Indicates if the status is a connector error status, meaning "The * connector failed to send or receive an apparently valid message". * * @return True if the status is a connector error status. */ public boolean isConnectorError() { return isConnectorError(getCode()); }
/** * Indicates if the status is a connector error status, meaning "The * connector failed to send or receive an apparently valid message". * * @return True if the status is a connector error status. */ public boolean isConnectorError() { return isConnectorError(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 an error is recoverable, meaning that simply retrying after * a delay could result in a success. Tests {@link #isConnectorError()} and * if the status is {@link #CLIENT_ERROR_REQUEST_TIMEOUT} or * {@link #SERVER_ERROR_GATEWAY_TIMEOUT} or * {@link #SERVER_ERROR_SERVICE_UNAVAILABLE}. * * @return True if the error is recoverable. */ public boolean isRecoverableError() { return isConnectorError() || equals(Status.CLIENT_ERROR_REQUEST_TIMEOUT) || equals(Status.SERVER_ERROR_GATEWAY_TIMEOUT) || equals(Status.SERVER_ERROR_SERVICE_UNAVAILABLE); }
/** * Indicates if an error is recoverable, meaning that simply retrying after * a delay could result in a success. Tests {@link #isConnectorError()} and * if the status is {@link #CLIENT_ERROR_REQUEST_TIMEOUT} or * {@link #SERVER_ERROR_GATEWAY_TIMEOUT} or * {@link #SERVER_ERROR_SERVICE_UNAVAILABLE}. * * @return True if the error is recoverable. */ public boolean isRecoverableError() { return isConnectorError() || equals(Status.CLIENT_ERROR_REQUEST_TIMEOUT) || equals(Status.SERVER_ERROR_GATEWAY_TIMEOUT) || equals(Status.SERVER_ERROR_SERVICE_UNAVAILABLE); }
if (status.isServerError()) { level = Level.WARNING; } else if (status.isConnectorError()) { level = Level.INFO; } else if (status.isClientError()) {
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().isConnectorError()) { throw new RuntimeException("Restlet Cloud communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) {
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().isConnectorError()) { throw new RuntimeException("APISpark communication error. Please check the root cause below.", e); } else if (e.getStatus().isClientError()) {
/** * 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()) {