Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/build/cmd/coordinator: merge double error returns into one error #34246
Many parts of x/build return two errors, the "remote error" vs the "exec error". The first represents a command that executed remotely (but failed), and the latter is an error trying to even do the execution, and didn't even making to finding out the remote buildlet's exit status.
In the x/build these go by several names (rerr, err, network error, communication error) etc.
But the code gets ugly dealing with and propagating the two types of errors and I suspect not many points in the code care (retries, etc).
Now that Go 1.13 errors are a bit more mature (https://golang.org/doc/go1.13#error_wrapping) it's probably time to clean up x/bulid's errors and collapse all the double error returns back into one, where the "it was a failure to communicate" bit (or alternatively, perhaps easier: "the successfully failed" bit) are just a property on the error that we can ask about questions about when a caller cares.
/cc @dmitshur (who I can tell from his recent CLs has been hating this)