Examples of ClientException


Examples of br.com.caelum.restfulie.http.error.ClientException

          + " when executing request");
    }

    if (code == 402 || code == 406 || code == 408 || code == 411
        || (code >= 413 && code <= 499)) {
      throw new ClientException("Http error " + code
          + " when executing request");
    }

    if (code == 501) {
      throw new NotImplementedException("Http error " + code
View Full Code Here

Examples of com.apitrary.api.client.exception.ClientException

  protected <T> URI buidURI(Request<T> request){
    URL url = null;
    try {
      url = api.getURL();
    } catch (MalformedURLException e) {
      throw new ClientException(e);
    }
    String path = inquirePath(request);
    Map<String,String> qry = RequestUtil.resolveQueryPart(request);
   
    Set<String> keys = qry.keySet();
    String query = "";
    if(!keys.isEmpty()){
      for(String key : keys){
        query += (!query.isEmpty()?"&":"?")+key+"="+qry.get(key);
      }
    }
   
    String fqrn = url.toString() + path + query;
    try {
      return new URI(fqrn);
    } catch (URISyntaxException e) {
      throw new ClientException(e);
    }
  }
View Full Code Here

Examples of com.cisco.oss.foundation.http.ClientException

      // if you caught NoActiveServersException but you are NOT
      // firstInChain - then throw back error and don't try to reconnect
      if (throwable instanceof NoActiveServersDeadEndException || throwable instanceof NoActiveServersIOException
          || (!(throwable instanceof RemoteAccessException) && !(throwable instanceof NoActiveServersException) && !(throwable instanceof IOException) && (throwable.getCause() != null && throwable.getCause().getCause() != null && !(throwable.getCause().getCause() instanceof IOException)) && (throwable.getCause() != null && !(throwable.getCause() instanceof IOException)) || (/*!firstInChain &&*/ throwable instanceof NoActiveServersException))) {
        LOGGER.error(errorMessage, throwable);
                throw new ClientException(throwable.toString(),throwable);
      }
    }

    if (LOGGER.isDebugEnabled()) {
      // LOGGER.warn(errorMessage + ". Exception is: " + throwable);
View Full Code Here

Examples of com.intel.mtwilson.ClientException

    protected String toJson(Object value) throws ClientException {
        try {
            return mapper.writeValueAsString(value);
        }
        catch(Exception e) {
            throw new ClientException("Cannot serialize object", e);
        }
    }
View Full Code Here

Examples of com.thimbleware.jmemcached.protocol.exceptions.ClientException

        if (keystring.startsWith("clear")) {
            try {
                // clear|bbs|pass
                String[] clientInfo = QueueClient.parse(keystring, '|');
                if (clientInfo.length < 3 || valid(clientInfo[1], clientInfo[2]) == false) {
                    throw new ClientException("Authorization error");
                }
                AbstractQueue<byte[]> queue = getClientQueue(clientInfo[1]);
                queue.clear();
                LocalCacheElement element = new LocalCacheElement(keystring, 0, 0, 0);
                element.setData(String.valueOf(queue.size()).getBytes());
                return element;
            } catch (Exception e) {
                log.error("getsize " + keystring + "error", e);
                return null;
            }
        }
        // 重新加载权限信息
        if (keystring.startsWith("reload")) {
            try {
                // reload|bbs|pass
                String[] clientInfo = QueueClient.parse(keystring, '|');
                if (clientInfo.length < 3 || valid(clientInfo[1], clientInfo[2]) == false) {
                    throw new ClientException("Authorization error");
                }
                reloadAuthorization();
                LocalCacheElement element = new LocalCacheElement(keystring, 0, 0, 0);
                element.setData("reloadAuthorization".getBytes());
                return element;
            } catch (ConfigException e) {
                log.error(e.getMessage(), e);
            } catch (Exception e) {
                log.error("reloadAuthorization error", e);
                return null;
            }
        }
        throw new ClientException(keystring + " command Unsupported now");
    }
View Full Code Here

Examples of com.thimbleware.jmemcached.protocol.exceptions.ClientException

                } else {
                    log.info("queue empty");
                }
            } else {
                log.error("unvalid " + keystring);
                throw new ClientException("Authorization error");
            }
        } catch (Exception e) {
            log.error("get queue " + keystring + " error", e);
            return null;
        }
View Full Code Here

Examples of com.thimbleware.jmemcached.protocol.exceptions.ClientException

        String[] clientInfo = QueueClient.parseWithCache(keystring);
        if (valid(clientInfo[0], clientInfo[1])) {// 先进行密码验证
            getClientQueue(clientInfo[0]).add(e.getData());
            return null;
        } else {
            throw new ClientException("Authorization error");
        }
    }
View Full Code Here

Examples of com.thimbleware.jmemcached.protocol.exceptions.ClientException

        String[] clientInfo = QueueClient.parseWithCache(keystring);
        if (valid(clientInfo[0], clientInfo[1])) {// 先进行密码验证
            getClientQueue(clientInfo[0]).add(e.getData());
            return null;
        } else {
            throw new ClientException("Authorization error");
        }

    }
View Full Code Here

Examples of com.yammer.tenacity.core.helper.ClientException

    }

    @Test
    public void testFallback(){
        UniformInterfaceException exception = new UniformInterfaceException("failed request", mock(ClientResponse.class));
        ClientException clientException = new ClientException(exception);
        ClientResponseResult<String> failedResult = ClientResponseResult.clientFailure(clientException);

        assertThat(failedResult.isSuccess(), is(false));
        assertThat(failedResult.getFallbackException(), is(clientException));
        assertThat(failedResult.getFallbackException().getCause().getMessage(), is("failed request"));
View Full Code Here

Examples of cz.matfyz.aai.fantom.server.ClientException

        messageLogWriter.write("\n");
        messageLogWriter.flush();
      }
    }
    catch(IOException e) {
      throw new ClientException("Sending the message to the client failed", client);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.