Reduced errors and CMDS WORK - EH

This commit is contained in:
Norbi Peti 2017-05-14 01:16:54 +02:00
parent 28aeb35573
commit 3e1df267cf
2 changed files with 9 additions and 12 deletions

View file

@ -40,6 +40,7 @@ import java.lang.String;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
@ -149,25 +150,21 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
}
PlayersWithFlairs.add(ign); // Don't redownload even if flair isn't accepted
}
try {
Thread.sleep(10);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
} catch (Exception e) {
errorcount++;
if (errorcount >= 10) {
errorcount = 0;
if (!e.getMessage().contains("Server returned HTTP response code"))
if (!e.getMessage().contains("Server returned HTTP response code")
&& !(e instanceof UnknownHostException))
TBMCCoreAPI.SendException("Error while getting flairs from Reddit!", e);
}
}
try {
Thread.sleep(10000);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}

View file

@ -11,7 +11,7 @@ import buttondevteam.lib.chat.TBMCChatAPI;
import buttondevteam.lib.chat.TBMCCommandBase;
import buttondevteam.lib.player.TBMCPlayer;
@CommandClass(modOnly = false)
@CommandClass(modOnly = false, excludeFromPath = true)
public abstract class AppendTextCommandBase extends TBMCCommandBase {
public abstract String[] GetHelpText(String alias);