Added two ways to define your own error templates.