Error codes are mostly a relic of procedural programming: the object-oriented paradigm has introduced exceptions as a first-class mechanism to separate error handling from. This refactoring targets special error values returned by methods and transform them into exceptions.