Index: dm/appengine/deps/ensure_graph_data.go |
diff --git a/dm/appengine/deps/ensure_graph_data.go b/dm/appengine/deps/ensure_graph_data.go |
index bc567b6e598434ac988abcefebcb6926395ba248..38f497685db4453d4e4e217af5371409ed7deafd 100644 |
--- a/dm/appengine/deps/ensure_graph_data.go |
+++ b/dm/appengine/deps/ensure_graph_data.go |
@@ -143,8 +143,7 @@ func journalQuestAttempts(c context.Context, newQuests []*model.Quest, newAttemp |
DoNotMergeQuest: true, |
}) |
} |
- return grpcAnnotate(tumble.AddToJournal(c, muts...), codes.Internal). |
- Reason("attempting to journal").Err() |
+ return grpcAnnotate(tumble.AddToJournal(c, muts...), codes.Internal, "attempting to journal").Err() |
} |
func (d *deps) ensureGraphData(c context.Context, req *dm.EnsureGraphDataReq, newQuests []*model.Quest, newAttempts *dm.AttemptList, rsp *dm.EnsureGraphDataRsp) (err error) { |
@@ -176,7 +175,7 @@ func (d *deps) ensureGraphData(c context.Context, req *dm.EnsureGraphDataReq, ne |
} |
}) |
if err != nil { |
- return grpcAnnotate(err, codes.Internal).Reason("failed to gather prerequisites").Err() |
+ return grpcAnnotate(err, codes.Internal, "failed to gather prerequisites").Err() |
} |
// Now that we've walked the graph, prune the lists of new Quest and Attempts |
@@ -185,7 +184,7 @@ func (d *deps) ensureGraphData(c context.Context, req *dm.EnsureGraphDataReq, ne |
newQuests, newQuestSet := filterQuestsByNewTemplateData(rsp.Result, newQuests) |
newAttempts, newAttemptsLen, err := filterAttemptsByDNE(rsp.Result, newAttempts, newQuestSet) |
if err != nil { |
- return grpcAnnotate(err, codes.InvalidArgument).Reason("filterAttemptsByDNE").Err() |
+ return grpcAnnotate(err, codes.InvalidArgument, "filterAttemptsByDNE").Err() |
} |
// we're just asserting nodes, no edges, so journal whatever's left |
@@ -299,8 +298,8 @@ func renderRequest(c context.Context, req *dm.EnsureGraphDataReq) (rsp *dm.Ensur |
} |
if err = d.Validate(qDesc.DistributorParameters); err != nil { |
- err = grpcAnnotate(err, codes.InvalidArgument). |
- Reason("JSON distributor parameters are invalid for this distributor configuration.").Err() |
+ err = grpcAnnotate(err, codes.InvalidArgument, |
+ "JSON distributor parameters are invalid for this distributor configuration.").Err() |
return |
} |
@@ -368,7 +367,7 @@ func (d *deps) EnsureGraphData(c context.Context, req *dm.EnsureGraphDataReq) (r |
logging.Fields{"execution": req.ForExecution.Id}.Infof(c, "on behalf of") |
_, _, err := model.AuthenticateExecution(c, req.ForExecution) |
if err != nil { |
- return nil, grpcAnnotate(err, codes.Unauthenticated).Reason("bad execution auth").Err() |
+ return nil, grpcAnnotate(err, codes.Unauthenticated, "bad execution auth").Err() |
} |
} else { |
if err = canWrite(c); err != nil { |