Skip to content

Commit

Permalink
fix: add more info about errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Oct 20, 2022
1 parent 7ffef86 commit c158fc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/corehttp/gateway_handler_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,16 @@ func (i *gatewayHandler) serveCodec(ctx context.Context, w http.ResponseWriter,

universal, ok := obj.(ipldlegacy.UniversalNode)
if !ok {
webError(w, "todo", fmt.Errorf("%T is not a valid IPLD node", obj), http.StatusInternalServerError)
err = fmt.Errorf("%T is not a valid IPLD node", obj)
webError(w, err.Error(), err, http.StatusInternalServerError)
return
}
finalNode := universal.(ipld.Node)

// Otherwise convert it using the last codec of the list.
encoder, err := multicodec.LookupEncoder(codecs[len(codecs)-1])
if err != nil {
webError(w, "todo", err, http.StatusInternalServerError)
webError(w, err.Error(), err, http.StatusInternalServerError)
return
}

Expand Down

0 comments on commit c158fc3

Please sign in to comment.