I am writing an errohandler at the moment, and I'd like to be able to record the values of any parameters passed into the sub/function where the exception occured.

I can find the sub/function using reflection, and I can even find the names of the parameters, I would now like to take it one step further and return the values...

Any ideas?