Skip to content

Commit

Permalink
Changed the default cancellation message for activity.
Browse files Browse the repository at this point in the history
  • Loading branch information
gurmitteotia committed Oct 21, 2018
1 parent 3ba9f52 commit 33d4562
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Guflow.Tests/Worker/ActivityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion Guflow/Worker/Activity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private async Task<ActivityResponse> 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)
{
Expand Down

0 comments on commit 33d4562

Please sign in to comment.