Check duplicated tags before parsing a file as yaml

This commit is contained in:
Yishi Lin 2018-04-07 00:16:06 +08:00
parent f7eabd8258
commit 54c7acf651
2 changed files with 23 additions and 0 deletions

View file

@ -16,6 +16,7 @@ public enum AppError: Error {
case GitResetError
case PGPPublicKeyNotExistError
case WrongPasswordFilename
case YamlLoadError
case UnknownError
}
@ -36,6 +37,8 @@ extension AppError: LocalizedError {
return "PGP public key doesn't exist."
case .WrongPasswordFilename:
return "Cannot write to the password file."
case .YamlLoadError:
return "Cannot be parsed as a YAML file."
case .UnknownError:
return "Unknown error."
}