Error catching in block template