StackOverflowException when running backgroundjob

Hello ,

I’m using HF with asp .net .
I can successfully run some of my methods, but I came across a method that threw a StackOverflowException.
that caused my VS to crash along with HF ,
after reloading I see that the job tries to run again (I have retry=0), and the job is stuck on the processing state and won’t move to the failure state.
I can resolve the offending line that causes the crash , but I’m more interested in jobs moving to the failed section when they fail.

any help is much appreciated .