mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
pkg/download: return 404 on list/latest (#1299)
This commit is contained in:
committed by
Aaron Schlesinger
parent
7fa1e00775
commit
e4534a20db
@@ -1,5 +1,7 @@
|
||||
module github.com/gomods/athens
|
||||
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.26.0
|
||||
contrib.go.opencensus.io/exporter/stackdriver v0.6.0
|
||||
|
||||
@@ -66,7 +66,14 @@ func (l *vcsLister) List(ctx context.Context, mod string) (*storage.RevInfo, []s
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
err = fmt.Errorf("%v: %s", err, stderr)
|
||||
return nil, nil, errors.E(op, err)
|
||||
// as of now, we can't recognize between a true NotFound
|
||||
// and an unexpected error, so we choose the more
|
||||
// hopeful path of NotFound. This way the Go command
|
||||
// will not log en error and we still get to log
|
||||
// what happened here if someone wants to dig in more.
|
||||
// Once, https://github.com/golang/go/issues/30134 is
|
||||
// resolved, we can hopefully differentiate.
|
||||
return nil, nil, errors.E(op, err, errors.KindNotFound)
|
||||
}
|
||||
|
||||
var lr listResp
|
||||
|
||||
Reference in New Issue
Block a user