Package com.github.jreddit.exception

Examples of com.github.jreddit.exception.ActionFailedException


          .withUrl(ApiEndpointUtils.REDDIT_BASE_URL + urlPath)
          .withCookie(cookie),
          convertRequestStringToList(apiParams)
      );
      if (result == null) {
        throw new ActionFailedException("Due to unknown reasons, the response was undefined for URI path: " + urlPath);
      } else {
        return result;
      }
    } catch (URISyntaxException e) {
      throw new ActionFailedException("The syntax of the URI path was incorrect: " + urlPath);
    } catch (IOException e) {
      throw new ActionFailedException("Input/output failed when retrieving from URI path: " + urlPath);
    } catch (ParseException e) {
      throw new ActionFailedException("Failed to parse the response from GET request to URI path: "+ urlPath);
    }
   
  }
View Full Code Here


    // Execute request
    Response response = httpClient.execute(request, responseHandler);
   
    // A HTTP error occurred
    if (response != null && response.getStatusCode() >= 300) {
      throw new ActionFailedException("HTTP Error (" + response.getStatusCode() + ") occurred for URI path: " + request.getURI().toString());
    }
   
    return response;
   
  }
View Full Code Here

TOP

Related Classes of com.github.jreddit.exception.ActionFailedException

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.