As a library user I want to have a errors understandable at a glance without looking what the error number means. In #3 I have a error Pthread(22) which I can't understand quickly. Making the error be a named constant (a enum variant) allows me to understand the error quickly: Error::Pthread(PthreadError::EINVAL).
As a library user I want to have a errors understandable at a glance without looking what the error number means. In #3 I have a error
Pthread(22)which I can't understand quickly. Making the error be a named constant (aenumvariant) allows me to understand the error quickly:Error::Pthread(PthreadError::EINVAL).