From c158fc3dbf32c6189032433b92643fb0d7b059d5 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 20 Oct 2022 12:50:44 +0200 Subject: [PATCH] fix: add more info about errors --- core/corehttp/gateway_handler_codec.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/corehttp/gateway_handler_codec.go b/core/corehttp/gateway_handler_codec.go index 7e01ab7923ed..95defa956dd5 100644 --- a/core/corehttp/gateway_handler_codec.go +++ b/core/corehttp/gateway_handler_codec.go @@ -89,7 +89,8 @@ 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) @@ -97,7 +98,7 @@ func (i *gatewayHandler) serveCodec(ctx context.Context, w http.ResponseWriter, // 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 }