Package com.atlassian.jira.rest.client

Examples of com.atlassian.jira.rest.client.RestClientException


//      }
//
      try {
        final String body = e.getResponse().getEntity(String.class);
        final Collection<String> errorMessages = extractErrors(body);
        throw new RestClientException(errorMessages, e);
      } catch (JSONException e1) {
        throw new RestClientException(e);
      }
    } catch (RestClientException e) {
      throw e;
    } catch (Exception e) {
      throw new RestClientException(e);
    }
  }
View Full Code Here


            try {
              final int id = Integer.parseInt(key);
              final Transition transition = transitionJsonParser.parse(jsonObject.getJSONObject(key), id);
              transitions.add(transition);
            } catch (JSONException e) {
              throw new RestClientException(e);
            } catch (NumberFormatException e) {
              throw new RestClientException("Transition id should be an integer, but found [" + key + "]", e);
            }
          }
          return transitions;
        }
      }
View Full Code Here

    if (jql.length() > MAX_JQL_LENGTH_FOR_HTTP_GET) {
      final JSONObject postEntity = new JSONObject();
      try {
        postEntity.put(JQL_ATTRIBUTE, jql);
      } catch (JSONException e) {
        throw new RestClientException(e);
      }
      return postAndParse(searchUri, postEntity, searchResultJsonParser, progressMonitor);
    } else {
      final URI uri = UriBuilder.fromUri(searchUri).queryParam(JQL_ATTRIBUTE, jql).build();
      return getAndParse(uri, searchResultJsonParser, progressMonitor);
View Full Code Here

      try {
        postEntity.put(JQL_ATTRIBUTE, jql);
        postEntity.put(START_AT_ATTRIBUTE, startAt);
        postEntity.put(MAX_RESULTS_ATTRIBUTE, maxResults);
      } catch (JSONException e) {
        throw new RestClientException(e);
      }
      return postAndParse(searchUri, postEntity, searchResultJsonParser, progressMonitor);
    } else {
      final URI uri = UriBuilder.fromUri(searchUri).queryParam(JQL_ATTRIBUTE, jql).queryParam(MAX_RESULTS_ATTRIBUTE, maxResults)
          .queryParam(START_AT_ATTRIBUTE, startAt).build();
View Full Code Here

  public static URI parseURI(String str) {
    try {
      return new URI(str);
    } catch (URISyntaxException e) {
      throw new RestClientException(e);
    }
  }
View Full Code Here

  public static DateTime parseDateTime(String str) {
    try {
      return JIRA_DATE_TIME_FORMATTER.parseDateTime(str);
    } catch (Exception e) {
      throw new RestClientException(e);
    }
  }
View Full Code Here

      return JIRA_DATE_TIME_FORMATTER.parseDateTime(str);
    } catch (Exception ignored) {
      try {
        return JIRA_DATE_FORMATTER.parseDateTime(str);
      } catch (Exception e) {
        throw new RestClientException(e);
      }
    }
  }
View Full Code Here

  public static DateTime parseDate(String str) {
    try {
      return JIRA_DATE_FORMATTER.parseDateTime(str);
    } catch (Exception e) {
      throw new RestClientException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.RestClientException

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.