Better error message

Added better error message when a grouped-by with sort query fails