Why doesn't Warlock take shock damage against Guardian?

I just lost my BG game because of that match-up, but I don't understand what in Warlock's kit prevent shock damage from Guardian? What am I missing? Thank you for the explanation!
0
Comments
But still he wasn't taking any damages from the shock he would have take from reduced ability accuracy.