Package com.baidu.rpc.exception

Examples of com.baidu.rpc.exception.JsonRpcException


        return gson.fromJson(result, method.getGenericReturnType());
      }
    } else {
      JsonElement e = res.get("error");
      if (e != null) {
        JsonRpcException jre = exceptionHandler.deserialize(e);
        if (jre instanceof ServerErrorException) {
          String msg = jre.getMessage();
          Class<?>[] exp_types = method.getExceptionTypes();
          for (Class<?> exp_type : exp_types) {
            if (msg.equals(exp_type.getSimpleName())) {
              Exception custom_exp = (Exception) exp_type
                  .newInstance();
              custom_exp.initCause(jre.getCause());
              throw custom_exp;
            }
          }
        }
        throw jre;
View Full Code Here

TOP

Related Classes of com.baidu.rpc.exception.JsonRpcException

Copyright © 2018 www.massapicom. 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.