I have this code
static void TaskRun(Action action)
{
Task.Run(() => { try { action();} catch {}});
}
static void Run()
{
TaskRun(() => {int a =5; a = a *5;})
}
I want to get the content of the action parameters as string (e.g. "int a =5; a = a *5;"
) in my TaskRun function.
The reason is that i want to wrap all the Task.run with the try catch and in my catch i want to print the code that causes the crash