Thanks for the reply Tom!
The log_error_function is being called by thousands of functions and that is why I thought it would be great if there was a way without making changes to it and subsequently writing code to pass the parameters in all these exception block.
Would have been awesome if error logging function could get the previous exception details somehow.