diff --git a/pkg/logcli/query/query.go b/pkg/logcli/query/query.go index 804d697380df5..cb693a0125139 100644 --- a/pkg/logcli/query/query.go +++ b/pkg/logcli/query/query.go @@ -553,12 +553,12 @@ func LoadSchemaUsingObjectClient(oc chunk.ObjectClient, name string) (*config.Sc defer cancel() ok, err := oc.ObjectExists(ctx, name) - if !ok { - return nil, errNotExists - } if err != nil { return nil, err } + if !ok { + return nil, errNotExists + } rdr, _, err := oc.GetObject(ctx, name) if err != nil {