Two main options come to mind.
For the Sawtooth Script option, I would add this near the beginning of your code, replacing "list1" with your row list:
var rowsList = [% ListLabelsArray(list1) %];
Then you can pull row labels from that array:
strErrorMessage = 'Error for row ' + rowsList[row - 1];
For the pure JavaScript option, you can update your error text like this:
strErrorMessage = 'Error for row ' + $('#[% QuestionName() %]_div .row_label_cell.grid_r' + row).text();