[AB-143] fixing incorrect parameter exception message, replacing incorrect parameter exception

This commit is contained in:
Sheldan
2020-10-07 15:15:16 +02:00
parent 0145e7670d
commit b8d19ab1e1
36 changed files with 82 additions and 71 deletions

View File

@@ -239,8 +239,9 @@ public class CommandReceivedHandler extends ListenerAdapter {
parsedParameters.add(handler.handle(value, iterators, param.getType(), message));
break;
}
} catch (NoSuchElementException e) {
throw new IncorrectParameterException(command, param.getType(), param.getName());
} catch (Exception e) {
log.warn("Failed to parse parameter with exception.", e);
throw new IncorrectParameterException(command, param.getName());
}
}
if(!handlerMatched) {