catch ex in lr
differentiable func