I'm implementing try catch enum:
enum processError: Error, CustomStringConvertible {
case one
var localizedDescription: String{
return "one"
}
case two
var localizedDescription: String {
return "two"
}
}
But I'm getting the following error:
type processError does not conform to protocol CustomStringConvertible
But if I change the name of the variable in the second case I don't get the error:
enum processError: Error, CustomStringConvertible {
case one
var localizedDescription: String{
return "one"
}
case two
var description: String {
return "two"
}
}
My question is why I can not have the same name of the variable for all the cases?
I'll really appreciate your help.