go.tools/dashboard/app: return specific error string on commit not found
TBR=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/153070043
This commit is contained in:
parent
51be54e32f
commit
fcf4a08452
|
@ -47,6 +47,9 @@ func commitHandler(r *http.Request) (interface{}, error) {
|
||||||
com.PackagePath = r.FormValue("packagePath")
|
com.PackagePath = r.FormValue("packagePath")
|
||||||
com.Hash = r.FormValue("hash")
|
com.Hash = r.FormValue("hash")
|
||||||
if err := datastore.Get(c, com.Key(c), com); err != nil {
|
if err := datastore.Get(c, com.Key(c), com); err != nil {
|
||||||
|
if err == datastore.ErrNoSuchEntity {
|
||||||
|
return nil, errors.New("Commit not found")
|
||||||
|
}
|
||||||
return nil, fmt.Errorf("getting Commit: %v", err)
|
return nil, fmt.Errorf("getting Commit: %v", err)
|
||||||
}
|
}
|
||||||
if com.Num == 0 {
|
if com.Num == 0 {
|
||||||
|
|
Loading…
Reference in New Issue