From ac42ad227299cc15479d6499a974f877084ca71d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 6 Oct 2016 20:11:07 +0200 Subject: [PATCH] Added better error messages for plugin updater --- src/main/java/buttondevteam/bucket/core/TBMCCoreAPI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/buttondevteam/bucket/core/TBMCCoreAPI.java b/src/main/java/buttondevteam/bucket/core/TBMCCoreAPI.java index 02ae431..7c49a1f 100644 --- a/src/main/java/buttondevteam/bucket/core/TBMCCoreAPI.java +++ b/src/main/java/buttondevteam/bucket/core/TBMCCoreAPI.java @@ -1,6 +1,7 @@ package buttondevteam.bucket.core; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; @@ -33,8 +34,14 @@ public final class TBMCCoreAPI { String ret = ""; URL url; try { - url = new URL("https://jitpack.io/com/github/TBMCPlugins/" + name + "/master-SNAPSHOT/" + name + "-master-SNAPSHOT.jar"); + url = new URL("https://jitpack.io/com/github/TBMCPlugins/" + name + "/master-SNAPSHOT/" + name + + "-master-SNAPSHOT.jar"); FileUtils.copyURLToFile(url, new File("plugins/" + name + ".jar")); + } catch (FileNotFoundException e) { + ret = "Can't find JAR, the build probably failed. Build log (scroll to bottom):\nhttps://jitpack.io/com/github/TBMCPlugins/" + + name + "/master-SNAPSHOT/build.log"; + } catch (IOException e) { + ret = "IO error - Did you spell the plugin's name correctly?\ne.getMessage()"; } catch (Exception e) { MainPlugin.Instance.getLogger().warning("Error!\n" + e); ret = e.toString();