3 ms·
Furthermore, once you redefine the concrete type, if your callers are expecting some set of well-known error values and checking values, say with equality, then
by andrewstuart2 10y ago
Furthermore, once you redefine the concrete type, if your callers are expecting some set of well-known error values and checking values, say with equality, then just redefine those variables as instances of the new type. API compatibility maintained.
- HeyImAlex 10y agoYou're usually creating typed errors so that you can attach more structured information, so equality won't work anymore.
- fauigerzigerk 10y agoI don't see the point of doing that. The point is, you can't add data specific to one particular function call to a singleton error value that you define on the package level.