DEV Community


Discussion on: Errors Are Not Exceptions

shalvah profile image

Another thing is: I feel like we may be co-opting language terminology and constructs into our programming model, rather than the other way around. For instance, just because a language says "We don't have exceptions" doesn't mean that's true. If it has some error-handling mechanism that acts identically to exceptions, in most languages, then those are exceptions.

I think distinguishing between "error" and "exception" is a doomed task, because those are defined by the language. I often use them interchangeably. Maybe we should use language-agnostic terms like "failures" vs "errors", where:

  • failure = this operation failed for an anticipated reason
  • error = this operation failed for an unexpected reason

In summary: This shit is confusing. 😂