| Index: milo/appengine/logdog/http.go
|
| diff --git a/milo/appengine/logdog/http.go b/milo/appengine/logdog/http.go
|
| index 43190b9074cec535178ce247f70b67646da313e2..906d39bed388ff42ad3c01542267bd478d08d3aa 100644
|
| --- a/milo/appengine/logdog/http.go
|
| +++ b/milo/appengine/logdog/http.go
|
| @@ -61,7 +61,25 @@ func (s *AnnotationStreamHandler) Render(c context.Context, req *http.Request, p
|
|
|
| // Load the Milo annotation protobuf from the annotation stream.
|
| if _, err := as.Fetch(c); err != nil {
|
| - return nil, err
|
| + switch errors.Unwrap(err) {
|
| + case coordinator.ErrNoSuchStream:
|
| + return nil, &miloerror.Error{
|
| + Message: "Stream does not exist",
|
| + Code: http.StatusNotFound,
|
| + }
|
| +
|
| + case coordinator.ErrNoAccess:
|
| + return nil, &miloerror.Error{
|
| + Message: "No access to stream",
|
| + Code: http.StatusForbidden,
|
| + }
|
| +
|
| + default:
|
| + return nil, &miloerror.Error{
|
| + Message: "Failed to load stream",
|
| + Code: http.StatusInternalServerError,
|
| + }
|
| + }
|
| }
|
|
|
| // Convert the Milo Annotation protobuf to Milo objects.
|
|
|