java.net.ProtocolException.toString()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中java.net.ProtocolException.toString()方法的一些代码示例,展示了ProtocolException.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ProtocolException.toString()方法的具体详情如下:
包路径:java.net.ProtocolException
类名称:ProtocolException
方法名:toString

ProtocolException.toString介绍

暂无

代码示例

代码示例来源:origin: iotoasis/SI

public void setRequestMethod( int requestMethod ){
  try {
    Constants.REQUEST_METHOD_TYPE obj = Constants.REQUEST_METHOD_TYPE.get( requestMethod );
    conn.setRequestMethod(obj.Name());
    conn.setDoOutput(obj.DoOutput());
  } catch( ProtocolException pe ) {
    Log.e(TAG, pe.toString());
  }
}

代码示例来源:origin: kaazing/gateway

public static void handleExtensionNegotiationException(HttpAcceptSession session, List<String> clientRequestedExtensions,
                            ProtocolException e, Logger logger) {
    // This happens when the extension negotiation leads to
    // a fatal failure; the session should be closed because
    // the service REQUIRED some extension that the client
    // did not request.
    if (logger.isDebugEnabled()) {
      if (logger.isDebugEnabled()) {
        // KG-10384: make sure port is explicitly included in the request URI we use for lookup since it is always
        // included when the service registry is created since we force use of explicit port in accepts.
        // TODO: consider doing this "at the edge" when the HTTP request object (or http session) is created.
        URI requestURI = HttpUtils.getRequestURI(session.getRequestURL(), session.getReadHeader("Host"),
            session);
        logger.debug(format(
            "Rejected %s request for URI \"%s\" on session '%s': failed to negotiate client requested extensions '%s'"
            + " due to exception %s",
            session.getMethod(), requestURI, session, clientRequestedExtensions, e.toString()));
      }
    }
    session.setStatus(HttpStatus.CLIENT_NOT_FOUND);
    session.setReason("WebSocket Extensions not found or invalid");
    session.close(false);
  }

代码示例来源:origin: apache/directory-kerby

conn.setRequestMethod("PUT");
} catch (ProtocolException e) {
  LOG.warn("Failed to set request method. " + e.toString());
  continue;

代码示例来源:origin: org.apache.kerby/has-client

conn.setRequestMethod("PUT");
} catch (ProtocolException e) {
  LOG.warn("Failed to set request method. " + e.toString());
  continue;

相关文章