Skip to content

Commit

Permalink
Update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Aug 7, 2018
1 parent ed1b45f commit 86fbb2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
10 changes: 6 additions & 4 deletions README.md
@@ -1,5 +1,7 @@
![https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png](https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png)<br>
SubServers 2 is a rewrite of SubServers, the Server Management Platform. &nbsp; [![Build Status](https://src.me1312.net/jenkins/job/SubServers%20Platform/badge/icon)](https://src.me1312.net/jenkins/job/SubServers%20Platform/)<br>
# ![https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png](https://s3.postimg.cc/dikyxlz5v/Sub_Banner.png)
[![Build Status](https://src.me1312.net/jenkins/job/SubServers%20Platform/badge/icon)](https://src.me1312.net/jenkins/job/SubServers%20Platform/)
[![Release Verison](https://img.shields.io/github/release/ME1312/SubServers-2/all.svg)](https://github.com/ME1312/SubServers-2/releases) [![Snapshot Verison](https://img.shields.io/badge/dynamic/xml.svg?label=snapshot&url=https%3A%2F%2Fsrc.me1312.net%2Fmaven%2Fnet%2FME1312%2FSubServers%2FSubServers.Bungee%2Fmaven-metadata.xml&query=%2F%2Fversioning%2Frelease&colorB=blue)](https://src.me1312.net/jenkins/job/SubServers%20Platform/)<br><br>
SubServers 2 is a rewrite of SubServers, the Server Management Platform.<br>
> [https://www.spigotmc.org/resources/subservers-bungee.11264/](https://www.spigotmc.org/resources/subservers-bungee.11264/)<br>
> [https://www.spigotmc.org/resources/subservers-host.38833/](https://www.spigotmc.org/resources/subservers-host.38833/)<br>
> [https://www.spigotmc.org/resources/subservers-sync.46124/](https://www.spigotmc.org/resources/subservers-sync.46124/)<br>
Expand All @@ -10,10 +12,10 @@ SubServers 2 is a rewrite of SubServers, the Server Management Platform. &nbsp;
These are some quick links for common resources of SubServers 2.

### How to Install
[https://github.com/ME1312/SubServers-2/wiki/Install](https://github.com/ME1312/SubServers-2/wiki/Install)
> [https://github.com/ME1312/SubServers-2/wiki/Install](https://github.com/ME1312/SubServers-2/wiki/Install)
### Snapshot Downloads
[https://src.me1312.net/jenkins/job/SubServers Platform](https://src.me1312.net/jenkins/job/SubServers%20Platform)
> [https://src.me1312.net/jenkins/job/SubServers Platform](https://src.me1312.net/jenkins/job/SubServers%20Platform)
### Javadocs for Developers
> [https://src.me1312.net/jenkins/job/SubServers Platform/javadoc/SubServers.Bungee/](https://src.me1312.net/jenkins/job/SubServers%20Platform/javadoc/SubServers.Bungee/)<br>
Expand Down
Expand Up @@ -11,6 +11,7 @@
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;

import java.io.BufferedReader;
Expand All @@ -33,10 +34,10 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
label = "/" + label;
if (plugin.subdata == null) {
new IllegalStateException("SubData is not connected").printStackTrace();
return false;
if (!(sender instanceof ConsoleCommandSender)) sender.sendMessage(ChatColor.RED + "An exception has occurred while running this command");
} else if (plugin.lang == null) {
new IllegalStateException("There are no lang options available at this time").printStackTrace();
return false;
if (!(sender instanceof ConsoleCommandSender)) sender.sendMessage(ChatColor.RED + "An exception has occurred while running this command");
} else {
if (sender.hasPermission("subservers.command")) {
if (args.length > 0) {
Expand Down Expand Up @@ -460,8 +461,8 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
} else {
sender.sendMessage(plugin.api.getLang("SubServers", "Command.Generic.Invalid-Permission").replace("$str$", "subservers.command"));
}
return true;
}
return true;
}

private String[] printHelp(String label) {
Expand Down
6 changes: 3 additions & 3 deletions SubServers.Client/Bukkit/src/plugin.yml
Expand Up @@ -7,13 +7,13 @@ website: 'https://github.com/ME1312/SubServers-2'
commands:
subservers:
description: 'The SubServers Command'
usage: 'An exception may have occurred while running this command'
usage: '/subservers help'
subserver:
description: 'The SubServers Command'
usage: 'An exception may have occurred while running this command'
usage: '/subserver help'
sub:
description: 'The SubServers Command'
usage: 'An exception may have occurred while running this command'
usage: '/sub help'
permissions:
subservers.*:
description: 'Grants Access to to Everything in SubServers.Client'
Expand Down
Expand Up @@ -100,13 +100,11 @@ public CommandSpec spec() {
.build();
}

private boolean canRun(CommandSource sender) {
private boolean canRun(CommandSource sender) throws CommandException {
if (plugin.subdata == null) {
new IllegalStateException("SubData is not connected").printStackTrace();
return false;
throw new CommandException(Text.builder("An exception has occurred while running this command").color(TextColors.RED).build(), new IllegalStateException("SubData is not connected"), false);
} else if (plugin.lang == null) {
new IllegalStateException("There are no lang options available at this time").printStackTrace();
return false;
throw new CommandException(Text.builder("An exception has occurred while running this command").color(TextColors.RED).build(), new IllegalStateException("There are no lang options available at this time"), false);
} else {
return sender.hasPermission("subservers.command");
}
Expand Down

0 comments on commit 86fbb2c

Please sign in to comment.