Catching template processing errors