Error during fetching Details from temporal NonRetryableApplicationError

In one of my temporal activities, I am returning

appErr := temporal.NewNonRetryableApplicationError("message", "status", err, "data")
return data, appErr

In the workflow, which calls the activity,

err = workflow.ExecuteActivity(ctx, c.Activity, request, details).Get(ctx, &details) 
	if err != nil {
		var appErr *temporal.ApplicationError
	        if errors.As(err, &appErr) {
                       fmt.Println(appErr.HasDetails()) ------> returns false
			tempErr := appErr.Details(&data)
                        fmt.Println(data)-------------------------------> returns [ ] (empty)
			if tempErr!= nil{
				logger.Error("Application error")
				return tempErr
			}
		}
		return err
	}

There is an error in appErr.Details with error being returned as “no data available”.
Is there anything that I am missing?

Even though details is set in the NewNonRetryableApplicationError object, I am not able to fetch the details and put it in

I would like some help in how to fetch the details field that has been set in the NewNonRetryableApplicationError.

Duplicate of Fetching Details from temporal NonRetryableApplicationError, please see response there.

Thank you for the response. I have checked the response and I am having the same changes in code base. When i try printing the hasDetails() it is giving as false and the data is populating after the call appErr.Details(&data).

Could you pls help in resolving this issue.

Do you see details in the ActivityTaskFailed event in the workflow history?

When I print logger.err(logging.Error(err)) → prints as " time is old (type: ApplicationError, retryable: true): "

But I print after the below change,

logger.err(logging.Error(err))
if errors.As(err, &appErr) {
			var temp wfstatus
			fmt.Println(appErr.HasDetails())  ---> false
			preCheckErr := appErr.Details(&temp)
         		fmt.Println(temp)------------------------------>{         0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC    0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC map[] {{ { [] []} { [] []} { [] []}} { { [] []} { [] []} { [] []} { [] []} { [] []}} { { [] []} { [] []} { [] []} { [] []}} { { [] []}}} }
[]

Closing duplicate thread. See this onehttps://community.temporal.io/t/fetching-details-from-temporal-nonretryableapplicationerror/3138/6.