Throw the right exception for short templates