Improve template encap error message to make it actionable.

Change-Id: I1502f76eef45bede03efc335815b80fc51e7839d
Merge "Improve template encap error message to make it actionable."