errors: ErrUnsupported should document expected side effects #63942
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I'm struggling to figure out how to correctly use
errors.ErrUnsupported
.In the proposal, @rsc gave this example:
where
ErrTBD
is presumably what becameErrUnsupported
.Let's say hypothetically, we wanted to make
io.WriteString
make use oferrors.ErrUnsupported
, what would that look like?However, the only way this is possibly correct is if returning
errors.ErrUnsupported
also indicates that the operation had no side-effects and could thus be retried in an alternative way. As of right now, there is no such documented guarantee.If we do document that
errors.ErrUnsupported
is side-effect free, then it also means that this is error prune (pun intended) where returning the error up the call stack increases the probability that there are indeed side-effects from other operations.\cc @ianlancetaylor @bcmills
The text was updated successfully, but these errors were encountered: