diff --git a/Guflow.Tests/Worker/ActivityTests.cs b/Guflow.Tests/Worker/ActivityTests.cs index 44960f5..c5a8bfb 100644 --- a/Guflow.Tests/Worker/ActivityTests.cs +++ b/Guflow.Tests/Worker/ActivityTests.cs @@ -239,7 +239,7 @@ public async Task By_default_execution_method_convert_task_cancellation_exceptio var response = await activity.ExecuteAsync(_activityArgs); - Assert.That(response, Is.EqualTo(new ActivityCancelledResponse("The operation was canceled."))); + Assert.That(response, Is.EqualTo(new ActivityCancelledResponse("Activity name: CancelledActivity and version: 1.0 is cancelled."))); } [Test] @@ -552,6 +552,7 @@ public void Execute(CancellationToken cancellationToken) public bool CancellationRequested => _cancellationToken.IsCancellationRequested; } + [ActivityDescription("1.0")] private class CancelledActivity : Activity { private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); diff --git a/Guflow/Worker/Activity.cs b/Guflow/Worker/Activity.cs index 29a4c0b..de4d6f4 100644 --- a/Guflow/Worker/Activity.cs +++ b/Guflow/Worker/Activity.cs @@ -62,7 +62,8 @@ private async Task ExecuteActivityMethod(ActivityArgs activity } catch (OperationCanceledException exception) { - return Cancel(exception.Message); + var desc = ActivityDescription.FindOn(GetType()); + return Cancel($"Activity name: {desc.Name} and version: { desc.Version} is cancelled."); } catch (Exception exception) {