Examples of HttpError


Examples of com.balancedpayments.errors.HTTPError

        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() >= 299) {
            if (payload != null && status.getStatusCode() != 300)
                error(response, body, payload);
            else
                throw new HTTPError(response, body);
        }

        return payload;
    }
View Full Code Here

Examples of com.balancedpayments.errors.HTTPError

        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() >= 299) {
            if (payload != null && status.getStatusCode() != 300)
                error(response, body, payload);
            else
                throw new HTTPError(response, body);
        }

        return payload;
    }
View Full Code Here

Examples of com.balancedpayments.errors.HTTPError

        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() >= 299) {
            if (payload != null && status.getStatusCode() != 300)
                error(response, body, payload);
            else
                throw new HTTPError(response, body);
        }

        return payload;
    }
View Full Code Here

Examples of com.balancedpayments.errors.HTTPError

        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() >= 299) {
            if (payload != null && status.getStatusCode() != 300)
                error(response, body, payload);
            else
                throw new HTTPError(response, body);
        }

        return payload;
    }
View Full Code Here

Examples of com.balancedpayments.errors.HTTPError

        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() >= 299) {
            if (payload != null && status.getStatusCode() != 300)
                error(response, body, payload);
            else
                throw new HTTPError(response, body);
        }

        return payload;
    }
View Full Code Here

Examples of com.balancedpayments.errors.HTTPError

        StatusLine status = response.getStatusLine();
        if (status.getStatusCode() >= 299) {
            if (payload != null && status.getStatusCode() != 300)
                error(response, body, payload);
            else
                throw new HTTPError(response, body);
        }

        return payload;
    }
View Full Code Here

Examples of com.face4j.facebook.exception.HttpError

      throw new FacebookException(error);
    }
  }
 
  public static FacebookError getError(String response, int statusCode) {
    HttpError httpError =  gson.fromJson(response, HttpError.class);
    return new FacebookError(statusCode, "Exception Type: "+httpError.getError().getType()+ " " + httpError.getError().getMessage(), null);
  }
View Full Code Here

Examples of io.reactivex.netty.protocol.http.server.HttpError

   
    @Override
    public Observable<Void> handle(HttpServerRequest<ByteBuf> request, HttpServerResponse<ByteBuf> response) {
        // We don't support GET. 
        if (!request.getHttpMethod().equals(GET)) {
            return Observable.error(new HttpError(METHOD_NOT_ALLOWED));
        }
       
        RandomAccessFile raf = null;
       
        String sanitizedUri = sanitizeUri(request.getUri());
        if (sanitizedUri == null) {
            return Observable.error(new HttpError(FORBIDDEN));
        }
       
        URI uri = resolveUri(sanitizedUri);
        if (uri == null) {
            return Observable.error(new HttpError(NOT_FOUND));
        }
       
        File file = new File(uri);
        if (file.isHidden() || !file.exists()) {
            return Observable.error(new HttpError(NOT_FOUND));
        }

        if (file.isDirectory()) {
            return Observable.error(new HttpError(FORBIDDEN));
        }
       
        if (!file.isFile()) {
            return Observable.error(new HttpError(FORBIDDEN));
        }

        long fileLength;
        try {
            raf = new RandomAccessFile(file, "r");
View Full Code Here

Examples of io.reactivex.netty.protocol.http.server.HttpError

    }
   
    @Override
    public ErrorResponseGenerator<ByteBuf> call(Throwable t1) {
        if (t1 instanceof HttpError) {
            HttpError error = (HttpError)t1;
            if (error.getStatus().equals(HttpResponseStatus.NOT_FOUND)) {
                return new ConstantErrorResponseGenerator<ByteBuf>(_404_HTML_TEMPLATE);
            }
        }
        return null;
    }
View Full Code Here

Examples of io.reactivex.netty.protocol.http.server.HttpError

            this.template = template;
        }
       
        @Override
        public void updateResponse(HttpServerResponse<O> response, Throwable t) {
            HttpError error = (HttpError)t;
            response.setStatus(error.getStatus());
            response.getHeaders().set(HttpHeaders.Names.CONTENT_TYPE, "text/html");
            response.writeString(template);
        }
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.