Catch the exception in logic of finding templates.

@minggo 
OK. I will add a tip message.