Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    Possible duplicate of Why error codes are negated? Commented May 2, 2016 at 9:55
  • 2
    Depends on the language. In languages with exceptions, exceptions should be used to indicate error conditions. Commented May 2, 2016 at 10:28
  • TL;DR: Whether it is practice may vary. But it is rarely good. Commented May 2, 2016 at 10:38
  • enums effectively eliminate the need for such a concept, especially where the underlying numeric value is arbitrary. Commented May 9, 2016 at 13:16
  • @radarbob If you need to add Enum values for newly found errors in the future, you may break the compatibility. stackoverflow.com/questions/12715951/… Commented Aug 27, 2020 at 2:38