2 ms·
Because many libraries (including stdlib) return basic errors which you can do nothing else with. I think that's the main problem with this design - you're rel
by grey-area 7y ago
Because many libraries (including stdlib) return basic errors which you can do nothing else with.
I think that's the main problem with this design - you're reliant on others to produce errors you can reliably check against, and every library could potentially have its own error types (similar to the problems with a proliferation of exception types in languages using exceptions). When using your own libraries it is not a huge problem - as you say you can start using a more complex type.
Not sure what the answer is, but the error interface which only allows returning a string is partly to blame IMO.