Parsing: Error on duplicate entries

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander
2019-01-08 19:28:38 +05:30
parent b0612df990
commit fc03c635c1
3 changed files with 11 additions and 2 deletions
@@ -281,3 +281,5 @@
"macAlertUnrecognizedPeerKey (%@)" = "Peer contains unrecognized key '%@'";
"macAlertInfoUnrecognizedPeerKey" = "Valid keys are: 'PublicKey', 'PresharedKey', 'AllowedIPs', 'Endpoint' and 'PersistentKeepalive'";
"macAlertMultipleEntriesForKey (%@)" = "There should be only one entry per section for key '%@'";
@@ -45,6 +45,8 @@ extension TunnelConfiguration.ParseError: WireGuardAppError {
return (tr(format: "macAlertUnrecognizedPeerKey (%@)", value), tr("macAlertInfoUnrecognizedPeerKey"))
case .multiplePeersWithSamePublicKey:
return (tr("alertInvalidPeerMessagePublicKeyDuplicated"), "")
case .multipleEntriesForKey(let value):
return (tr(format: "macAlertMultipleEntriesForKey (%@)", value), "")
}
}
}