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.