@anamika1506, variables you have in your workflow are passed to the global exception handler.
you can access them in the handler with errorinfo.workflowarguments(“Key”), where the Key is the name of your variable. They are stored in a dictionary.
The rest depends on, what you need in your error handler.
The scenario you provided is great!
Using the “assign” activity, getting the value of a variable into Global Exception Handler, completely achieving the same effect like adding arguments.
Still be cautious with this solution . Also If my Answer helped you, you could mark it as “Solution” so other members have an easier time finding help as well.