From 57574497eeec92aab024c3116b2a652e1c7b923b Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 7 Mar 2022 22:27:05 +0100 Subject: [PATCH] Redact query errors --- x/wasm/keeper/query_plugins.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/wasm/keeper/query_plugins.go b/x/wasm/keeper/query_plugins.go index 63522add85..14371271e4 100644 --- a/x/wasm/keeper/query_plugins.go +++ b/x/wasm/keeper/query_plugins.go @@ -60,6 +60,12 @@ func (q QueryHandler) Query(request wasmvmtypes.QueryRequest, gasLimit uint64) ( if ok := errors.As(err, &noSuchContract); ok { return res, wasmvmtypes.NoSuchContract{Addr: noSuchContract.Addr} } + // Otherwise redact all (we can theoretically redact less in the future) + if err != nil { + // Issue #759 - we don't return error string for worries of non-determinism + // moduleLogger(ctx).Info("Redacting submessage error", "cause", err) + err = errors.New(redactError(err)) + } return res, err }