Android HttpException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android HttpException class.

This code example shows how to use the following methods:getMessage
        this.log.error("HTTP connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void exception(final NHttpClientConnection conn, final HttpException ex) {
        this.log.error("HTTP connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void requestReady(final NHttpClientConnection conn) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP connection " + conn + ": InRequest ready" + getRequestMessageID(conn));
        } 
        this.handler.requestReady(conn);
    } 
 
    public void outputReady(final NHttpClientConnection conn, final ContentEncoder encoder) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP connection " + conn + ": Output ready" + getRequestMessageID(conn));
        } 
6
CodeRank
This code example shows how to use the following methods:printStackTrace
This code example shows how to use the following methods:getMessage
this.handler.exception(conn, ex);
    } 
 
    public void exception(final NHttpServerConnection conn, final HttpException ex) {
        this.log.error("HTTP Error occured on connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void requestReceived(final NHttpServerConnection conn) {
        HttpRequest request = conn.getHttpRequest();
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP InRequest Received on connection " + conn + ": "
                    + request.getRequestLine());
        } 
        this.handler.requestReceived(conn);
    } 
 
    public void outputReady(final NHttpServerConnection conn, final ContentEncoder encoder) {
        if (this.log.isDebugEnabled()) {
6
CodeRank
This code example shows how to use the following methods:printStackTrace
    } 
    catch (IOException e) {
      e.printStackTrace();
    } 
    catch (HttpException e) {
      e.printStackTrace();
    } 
    return conn;
  } 
   
  public String accessKeyID() {
    String accessKeyID = ERXProperties.decryptedStringForKey("er.attachment." + configurationName() + ".cf.apiAccessKey");
    if (accessKeyID == null) {
      accessKeyID = ERXProperties.decryptedStringForKey("er.attachment.cf.apiAccessKey");
    } 
    if (accessKeyID == null) {
      throw new IllegalArgumentException("There is no 'er.attachment." + configurationName() + ".cf.apiAccessKey' or 'er.attachment.cf.apiAccessKey' property set.");
    } 
    return accessKeyID;
  } 
6
CodeRank
This code example shows how to use the following methods:getMessage
          + "' to CloudFiles: Error " + e.getHttpStatusCode()
          + ": " + e.getHttpStatusMessage());
    } 
    catch (HttpException e) {
      throw new IOException("Failed to delete '" + bucket + "/" + key
          + "' to CloudFiles: Error " + e.getMessage());
    } 
	} 
 
	@Override 
	public void attachmentInserted(ERCloudFilesAttachment attachment) {
		super.attachmentInserted(attachment);
		_queue.enqueue(attachment);
	} 
 
	public void performUpload(File uploadedFile, String originalFileName,
			String bucket, String key, String mimeType,
			ERCloudFilesAttachment attachment) throws MalformedURLException,
			IOException { 
		try { 
6
CodeRank
This code example shows how to use the following methods:getMessage
        this.log.error("HTTP connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void exception(final NHttpServerConnection conn, final HttpException ex) {
        this.log.error("HTTP connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void requestReceived(final NHttpServerConnection conn) {
        HttpRequest request = conn.getHttpRequest();
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP connection " + conn + ": " + request.getRequestLine());
        } 
        this.handler.requestReceived(conn);
        if (this.headerlog.isDebugEnabled()) {
            this.headerlog.debug(">> " + request.getRequestLine().toString());
            Header[] headers = request.getAllHeaders();
            for (int i = 0; i < headers.length; i++) {
                this.headerlog.debug(">> " + headers[i].toString());
5
CodeRank
This code example shows how to use the following methods:getMessage
        this.log.error("HTTP connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void exception(final NHttpClientConnection conn, final HttpException ex) {
        this.log.error("HTTP connection " + conn + ": " + ex.getMessage(), ex);
        this.handler.exception(conn, ex);
    } 
 
    public void requestReady(final NHttpClientConnection conn) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP connection " + conn + ": Request ready");
        } 
        this.handler.requestReady(conn);
    } 
 
    public void outputReady(final NHttpClientConnection conn, final ContentEncoder encoder) {
        if (this.log.isDebugEnabled()) {
            this.log.debug("HTTP connection " + conn + ": Output ready");
        } 
5
CodeRank
This code example shows how to use the following methods:printStackTrace
    public void fatalIOException(final IOException ex, final NHttpConnection conn) {
        ex.printStackTrace(System.out);
    } 
 
    public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) {
        ex.printStackTrace(System.out);
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:
        Mockito.when(conn.receiveRequestHeader()).thenReturn(request);
        final HttpResponse resp100 = new BasicHttpResponse(HttpVersion.HTTP_1_1, 100, "Continue");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_1, 100, context)).thenReturn(resp100);
        final HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, 500, "Oppsie");
        Mockito.when(responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 500, context)).thenReturn(response);
        Mockito.doThrow(new HttpException("Oopsie")).when(expectationVerifier).verify(request, resp100, context);
        Mockito.when(connReuseStrategy.keepAlive(response, context)).thenReturn(Boolean.FALSE);
 
        httpservice.handleRequest(conn, context);
 
        Assert.assertSame(conn, context.getConnection());
        Assert.assertSame(request, context.getRequest());
        Assert.assertSame(response, context.getResponse());
 
        Assert.assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatusLine().getStatusCode());
 
        Mockito.verify(conn).sendResponseHeader(response);
        Mockito.verify(conn, Mockito.never()).receiveRequestEntity(request);
        Mockito.verify(httprocessor).process(response, context);
        Mockito.verify(conn).sendResponseHeader(response);
5
CodeRank
This code example shows how to use the following methods:getMessage
            logger.info("I/O error: " + ex.getMessage());
        } 
 
        public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) 
        { 
            logger.info("HTTP error: " + ex.getMessage());
        } 
    } 
} 
 
4
CodeRank

Related Android HttpException Questions & Answers:

See Code Examples for Android HttpException Methods: