config: show more informative error message on wrong key

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-07-27 15:20:23 +02:00
parent 520df16885
commit 9f861096ac
4 changed files with 6 additions and 1 deletions
@@ -113,6 +113,8 @@ public class Peer {
public void parse(final String line) {
final Attribute key = Attribute.match(line);
if (key == null)
throw new IllegalArgumentException(String.format("Unable to parse line: \"%s\"", line));
switch (key) {
case ALLOWED_IPS:
addAllowedIPs(key.parseList(line));