code: protected SofaRpcException convertToRpcException(Exception e) {
          SofaRpcException exception;
          if (e instanceof SofaRpcException) {
              exception = (SofaRpcException) e;
          }
          // 超时
          else if (e instanceof InvokeTimeoutException) {
              exception = new SofaTimeOutException(e);
          }
          // 服务器忙
          else if (e instanceof InvokeServerBusyException) {
              exception = new SofaRpcException(RpcErrorType.SERVER_BUSY, e);
          }
          // 序列化
          else if (e instanceof SerializationException) {
              boolean isServer = ((SerializationException) e).isServerSide();
              exception = isServer ? new SofaRpcException(RpcErrorType.SERVER_SERIALIZE, e)
                  : new SofaRpcException(RpcErrorType.CLIENT_SERIALIZE, e);
          }
          // 反序列化
          else if (e instanceof DeserializationException) {
              boolean isServer = ((DeserializationException) e).isServerSide();
              exception = isServer ? new SofaRpcException(RpcErrorType.SERVER_DESERIALIZE, e)
                  : new SofaRpcException(RpcErrorType.CLIENT_DESERIALIZE, e);
          }
          // 长连接断连
          else if (e instanceof ConnectionClosedException) {
              exception = new SofaRpcException(RpcErrorType.CLIENT_NETWORK, e);
          }
          // 客户端发送失败
          else if (e instanceof InvokeSendFailedException) {
              exception = new SofaRpcException(RpcErrorType.CLIENT_NETWORK, e);
          }
          // 服务端未知异常
          else if (e instanceof InvokeServerException) {
              exception = new SofaRpcException(RpcErrorType.SERVER_UNDECLARED_ERROR, e.getCause());
          }
          // 客户端未知
          else {
              exception = new SofaRpcException(RpcErrorType.CLIENT_UNDECLARED_ERROR, e);
          }
          return exception;
      }
docs: 转换调用出现的异常为RPC异常
  
  @param e 异常
  @return RPC异常