It seems I found a solution to this. I had to modify my data being sent to the template to look like this:
hasError: {
friends: {
name: {
0: 'Friend name is required',
1: 'Friend name is required'
}
}
}
And then change my template to the following:
{?hasError.friends.name[$idx]}error-class{/hasError.friends.name[$idx]}
There is so little out there for complex dust.js but I managed to stumble accoss an article that had what I was looking for. Here is the link in case it could help someone else:
https://www.paypal-engineering.com/2013/12/05/dust-is-eloquent-round-and-round-we-go-2/