News for hackers. Stuff that matters.
Re:Error handling in Upspin by andreareina on Thursday December 07, 2017 @10:17AM (#15870714)
The docs[1] do say that the last of a particular type wins, though as I say in [2] it's not clear to me whether that's actually desirable, or if it's essentially an implementation detail (process the arguments in order and mutate the object) that got blessed because it's easier that way. I'd love to hear arguments for last-write-wins over immutable assignment.

It seems you can't implement custom interfaces on the core data types[3], so a do-nothing interface isn't an option to emulate sum types and enforce type-safety (E switches on string to set the error message). At least the code[4] gives you a run-time error instead of silently ignoring unsupported types.

[1] https://godoc.org/upspin.io/errors#E

[2] https://news.ycombinator.com/item?id=15870334

[3] http://www.jerf.org/iri/post/2917

[4] https://upspin.googlesource.com/upspin/+/master/errors/error...

There are no comments on this comment yet.