Identifying malformed search queries


I’m having trouble tracking down what’s wrong with because the user is receiving a 400 response from a search query. It pissed me off, so I entered

But I wonder what the ideal solution to debugging frustrating search queries is. Should we just return the fully interpolated string of the search query in the error? Should we perform some validation client-side? Should chef-server provide a secondary error message? Is the status quo sufficient?