Commit 9e32f653 authored by Steven Allen's avatar Steven Allen

fix: log a warning when the user passes a nonsensical query

parent 246a8307
...@@ -683,6 +683,11 @@ func (fs *Datastore) Query(q query.Query) (query.Results, error) { ...@@ -683,6 +683,11 @@ func (fs *Datastore) Query(q query.Query) (query.Results, error) {
// This datastore can't include keys with multiple components. // This datastore can't include keys with multiple components.
// Therefore, it's always correct to return an empty result when // Therefore, it's always correct to return an empty result when
// the user requests a filter by prefix. // the user requests a filter by prefix.
log.Warnw(
"flatfs was queried with a key prefix but flatfs only supports keys at the root",
"prefix", q.Prefix,
"query", q,
)
return query.ResultsWithEntries(q, nil), nil return query.ResultsWithEntries(q, nil), nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment