15 lines
738 B
Go
15 lines
738 B
Go
package buildstep
|
|
|
|
import sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
|
|
|
|
// Transport is err as a sdkstep.Passing when its words are those of a network that did not answer (a lookup, a timeout, a
|
|
// reset connection; sdkstep.PassingCause), so the build module's ask is given again after a delay instead of failing
|
|
// (novox/hq ADR 0664 §1, issue 1748); any other error, nil included, is returned as it is. Every build module wraps a step
|
|
// that fetches over the network with it: a failure of the source (an unknown revision, a wrong checksum) never is one.
|
|
func Transport(err error) error {
|
|
if err == nil || sdkstep.IsPassing(err) || !sdkstep.PassingCause(err.Error()) {
|
|
return err
|
|
}
|
|
return &sdkstep.Passing{Err: err}
|
|
}
|