From 7d62710808a38102c09c4f18b1309bf63051db5e Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Fri, 23 Oct 2020 13:45:15 +0200 Subject: 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. --- handler.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'handler.go') 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 -- cgit v1.2.3