print an error to console instead of blindly throwing an exception
This commit is contained in:
parent
ccb0e48ad1
commit
e8ecc43ede
1 changed files with 3 additions and 1 deletions
|
@ -38,7 +38,9 @@ public class DefaultCommand extends Command {
|
||||||
private static final SkinFunction DO_APPLY_SKIN = (sender, npc, skin) -> NPCSkin.forName(skin, (values, ex) -> {
|
private static final SkinFunction DO_APPLY_SKIN = (sender, npc, skin) -> NPCSkin.forName(skin, (values, ex) -> {
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
Configuration.MESSAGES.sendMessage(sender, ConfigurationValue.CANT_GET_SKIN, skin);
|
Configuration.MESSAGES.sendMessage(sender, ConfigurationValue.CANT_GET_SKIN, skin);
|
||||||
throw new RuntimeException(ex);
|
ZNPCsPlus.LOGGER.warning("Failed to fetch skin:");
|
||||||
|
ex.printStackTrace();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
npc.changeSkin(NPCSkin.forValues(values));
|
npc.changeSkin(NPCSkin.forValues(values));
|
||||||
Configuration.MESSAGES.sendMessage(sender, ConfigurationValue.GET_SKIN);
|
Configuration.MESSAGES.sendMessage(sender, ConfigurationValue.GET_SKIN);
|
||||||
|
|
Loading…
Reference in a new issue