Examples of UpdaterException


Examples of net.hearthstats.updater.exception.UpdaterException

      connection.connect();

      return new GitHubRequest(apiUrl, connection);
    } catch (IOException e) {
      throw new UpdaterException("Unable to open connection to URL " + url + " due to exception " + e.getMessage(), e);
    }
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

  Integer getResponseCode() {
    if (connection instanceof HttpURLConnection) {
      try {
        return ((HttpURLConnection) connection).getResponseCode();
      } catch (IOException e) {
        throw new UpdaterException("Unable to get status code from HTTP request due to exception " + e.getMessage(), e);
      }
    } else {
      return null;
    }
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

  Object read() {
    try (Reader inputReader = new InputStreamReader(connection.getInputStream(), "UTF-8")) {
      JSONParser parser = new JSONParser();
      return parser.parse(inputReader);
    } catch (ParseException e) {
      throw new UpdaterException("Unable to parse JSON due to exception " + e.getMessage(), e);
    } catch (UnsupportedEncodingException e) {
      throw new UpdaterException("Unable to parse JSON because UTF-8 encoding is unsupported, this should not be possible!", e);
    } catch (IOException e) {
      throw new UpdaterException("Unable to read data from URL " + apiUrl.toString() + " due to exception " + e.getMessage(), e);
    }
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

  List<JsonWrapper> readJsonArray() {
    Object output = read();
    if (output instanceof JSONArray) {
      return JsonWrapper.of((JSONArray) output);
    } else {
      throw new UpdaterException("Unable to read JSON array because the response is " + output.getClass().getSimpleName());
    }
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

  JsonWrapper readJsonObject() {
    Object output = read();
    if (output instanceof JSONObject) {
      return JsonWrapper.of((JSONObject) output);
    } else {
      throw new UpdaterException("Unable to read JSON object because the response is " + output.getClass().getSimpleName());
    }
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

      if (!release.isDraft() || includeDraftReleases) {
        return release;
      }
    }

    throw new UpdaterException("GitHub did not return information about the latest release");
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

      if (release.getOsxAsset() != null && (!release.isDraft() || includeDraftReleases)) {
        return release;
      }
    }

    throw new UpdaterException("GitHub did not return information about the latest release");
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

      if (release.getWindowsAsset() != null && (!release.isDraft() || includeDraftReleases)) {
        return release;
      }
    }

    throw new UpdaterException("GitHub did not return information about the latest release");
  }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

      this.x = x;
      this.y = y;
      try {
        image = ImageIO.read(getClass().getResource(resourceName));
      } catch (IOException ex) {
        throw new UpdaterException("Cannot read background image");
      }
    }
View Full Code Here

Examples of net.hearthstats.updater.exception.UpdaterException

        } catch (IOException e) {
          String error = "Unable to open connection to URL " + currentUrlString + " due to exception " + e.getMessage();
          window.log(error);
          errorOccurred = true;
          throw new UpdaterException(error, e);
        }
      }


      @Override
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.