aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-23 13:45:15 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-10-23 13:45:15 +0200
commit7d62710808a38102c09c4f18b1309bf63051db5e (patch)
tree26e46fdbb1b5084bc9c01c77da59570a836c30fd
parent0aba64da241caef9f66e3b28e3504ec93eea8593 (diff)
moved TODO on gRPC error codes to a note
It appears that a bad gRPC code is already captured as part of err. In other words, additional detail can be inside the following error clause. See example in CTFE's addChainInternal() function.
-rw-r--r--handler.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/handler.go b/handler.go
index a8165ec..80d7726 100644
--- a/handler.go
+++ b/handler.go
@@ -65,11 +65,7 @@ func addEntry(ctx context.Context, i *instance, w http.ResponseWriter, r *http.R
trillianResponse, err := i.client.QueueLeaf(ctx, &trillianRequest)
if err != nil {
return http.StatusInternalServerError, fmt.Errorf("backend QueueLeaf request failed: %v", err)
- }
- if trillianResponse == nil {
- return http.StatusInternalServerError, fmt.Errorf("missing QueueLeaf response")
- }
- // TODO: check that we got gRPC OK as specified in Trillian's API doc
+ } // note: more detail could be provided here, see addChainInternal in ctfe
glog.Infof("Queued leaf: %v", trillianResponse.QueuedLeaf.Leaf.LeafValue)
// TODO: respond with an SDI