Skip to content

Commit c9f3a25

Browse files
committed
app: fall back to default namespace looking for log entities
Fixes golang/go#9628 Change-Id: Ifc510417775010f2d13b546ae246f45246948234 Reviewed-on: https://go-review.googlesource.com/3505 Reviewed-by: Andrew Gerrand <[email protected]>
1 parent aef04bd commit c9f3a25

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

app/build/handler.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,17 @@ func logHandler(w http.ResponseWriter, r *http.Request) {
807807
key := datastore.NewKey(c, "Log", hash, 0, nil)
808808
l := new(Log)
809809
if err := datastore.Get(c, key, l); err != nil {
810-
logErr(w, r, err)
811-
return
810+
if err == datastore.ErrNoSuchEntity {
811+
// Fall back to default namespace;
812+
// maybe this was on the old dashboard.
813+
c := appengine.NewContext(r)
814+
key := datastore.NewKey(c, "Log", hash, 0, nil)
815+
err = datastore.Get(c, key, l)
816+
}
817+
if err != nil {
818+
logErr(w, r, err)
819+
return
820+
}
812821
}
813822
b, err := l.Text()
814823
if err != nil {

0 commit comments

Comments
 (0)