mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-05 10:20:23 +01:00
Added a sender notification for any exception that happens during reload #433
This commit is contained in:
parent
6e0b29c114
commit
c93d956285
@ -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) {
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user