Skip to content

Commit 129673c

Browse files
committed
Dummy enhancement of an error message
1 parent f3f3bcc commit 129673c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LocMapper CLI/Utils/ParseUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func dictionaryOptionFromArray(_ array: [String], allowEmpty: Bool = false) thro
4343
let keys = stride(from: array.startIndex, to: array.endIndex, by: 2).map{ array[$0] }
4444
let values = stride(from: array.index(after: array.startIndex), to: array.endIndex, by: 2).map{ array[$0] }
4545
guard (allowEmpty || !keys.isEmpty) && keys.count == values.count else {
46-
throw ValidationError("The array argument must not be empty and contain an even number of elements (alternance of keys and values)")
46+
throw ValidationError("The array argument must \(!allowEmpty ? "not be empty and " : "")contain an even number of elements (alternance of keys and values)")
4747
}
4848
return Dictionary(zip(keys, values), uniquingKeysWith: { _, new in new })
4949
}

0 commit comments

Comments
 (0)