[#834] RegisterCommand error no longer logged

- Added missing rethrow clause to RegisterCommand that caused error meant
  to the user being logged instead.
- Fixed username placeholder replacement to success message
This commit is contained in:
Rsl1122 2018-12-09 14:16:21 +02:00
parent 3f5551ffaa
commit d7dce0ac34

View File

@ -97,6 +97,8 @@ public class RegisterCommand extends CommandNode {
sender.sendMessage("§cPassword hash error.");
} catch (NumberFormatException e) {
throw new NumberFormatException(args[2]);
} catch (IllegalArgumentException e) {
throw e;
} catch (Exception e) {
errorHandler.log(L.WARN, this.getClass(), e);
}
@ -152,7 +154,7 @@ public class RegisterCommand extends CommandNode {
return;
}
database.save().webUser(webUser);
sender.sendMessage(locale.getString(CommandLang.WEB_USER_REGISTER_SUCCESS));
sender.sendMessage(locale.getString(CommandLang.WEB_USER_REGISTER_SUCCESS, userName));
logger.info(locale.getString(CommandLang.WEB_USER_REGISTER_NOTIFY, userName, webUser.getPermLevel()));
} catch (Exception e) {
errorHandler.log(L.WARN, this.getClass(), e);