Better error report if sort_by parsing fails