Pass exception as a parameter