handle errors which occur at the time of rendering

Erros could be thrown at the time of rendering instead of compiling
when functions are called in templates. By this correction,
the exception which occurs in renderFile at the time of rendering
is passed to a callback.