Added a sender notification for any exception that happens during reload #433

This commit is contained in:
Rsl1122 2017-11-24 19:49:36 +02:00
parent 6e0b29c114
commit c93d956285

View File

@ -1,5 +1,6 @@
package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.api.utility.log.Log;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
@ -34,7 +35,14 @@ public class ReloadCommand extends SubCommand {
@Override
public boolean onCommand(ISender sender, String commandLabel, String[] args) {
plugin.reloadPlugin(true);
try {
plugin.reloadPlugin(true);
} catch (Exception e) {
sender.sendMessage("§cSomething went wrong during reload of the plugin, a restart is recommended.");
String address = plugin.getWebServer().getAccessAddress() + "/debug";
sender.sendLink("More info can be found at ", address, address);
Log.toLog(this.getClass().getName(), e);
}
sender.sendMessage(Locale.get(Msg.CMD_INFO_RELOAD_COMPLETE).toString());
return true;
}