Improve error handling in metric definition validation

Improve error handling in metric definition validation

The following discussion from !52226 (merged) should be addressed:

  • @marc_shaw started a discussion:

    I wonder if having the error["data"] would be useful in the error message too 🤔

Edited by Alina Mihaila