3 ms·
I don't get it. How is "errors are values" different from anything? In what language are errors not values?
by millstone 12y ago
I don't get it. How is "errors are values" different from anything? In what language are errors not values?
- NateDad 12y agoIn languages where they are exceptions and are not returned, but thrown and require special syntax to handle.
- millstone 12y agoBut exceptions are values too, i.e. you routinely have an object of type IOException. All of the patterns presented in the article can be done easily with exceptions. I think maybe "errors are values" is a general principle and not meant to be specific to Go.
- alecbenzer 12y agoExceptions are values too but they're more than values. "Errors are values" means "errors are values so just deal with them like you do other values".