At runtime a variable may not be initialized, contrary to expectations. However the error message
Exception Type: NullReferenceException does not indicate which variable is throwing the exception. This is quite annoying in larger projects. So, can we have the name of the uninitialized variable inside the error message? I know uipath indicates which block failed, but they can have multiple variables.
Example: a web scraping workflow is expected to return a datatable, but the procedure returns an empty datatable. Later another invoked workflow tries to save the datatable to an xlsx file, which fails. Now I get to guess which variable the error message is referring to.
Main has thrown an exception
Source: Invoke workflow file: Append Range
Message: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized).
Exception Type: NullReferenceException
System.NullReferenceException: Object reference not set to an instance of an object.
at UiPath.Core.Activities.InvokeWorkflowFile.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)