I need to handle error codes for the project. Previously, the enums were implemented like the following
enum ErrorCode{
None=0,
InvalidUserName = 1,
InvalidEmail
}
Later, we thought to move to some user defined error code like the following.
"ERR001", "ERR001" .. etc.
For that, I have two options,
- Using string annotation for the enum
- Using constants or readonly static.
What is the best way to do either by enum (which does not support string) or constant?