Skip to content

Commit

Permalink
Improve error message for measures field names
Browse files Browse the repository at this point in the history
.. when trying to find the right values for the measures() datafilter
   function e.g. measures("Body", "weight") it was not clear why this
   was failing. Added more information to the error message.
  • Loading branch information
liversedge committed Apr 30, 2021
1 parent 55e9cdb commit d27327d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/DataFilter.cpp
Expand Up @@ -1996,7 +1996,8 @@ void Leaf::validateFilter(Context *context, DataFilterRuntime *df, Leaf *leaf)
int field = context->athlete->measures->getFieldSymbols(group).indexOf(field_symbol);
if (field < 0 && field_symbol != "date") {
leaf->inerror = true;
DataFiltererrors << QString(tr("invalid measures field '%1' for group '%2'.").arg(field_symbol).arg(group_symbol));
DataFiltererrors << QString(tr("invalid measures field '%1' for group '%2', should be one of: %3.").arg(field_symbol).arg(group_symbol)
.arg(context->athlete->measures->getFieldSymbols(group).join(", ")));
}
}
}
Expand Down

0 comments on commit d27327d

Please sign in to comment.