Couldn't that be a client-side check before the query is submitted?