1+ using System ;
2+
13namespace Temporalio . Exceptions
24{
35 /// <summary>
@@ -9,12 +11,27 @@ public class WorkflowAlreadyStartedException : FailureException
911 /// Initializes a new instance of the <see cref="WorkflowAlreadyStartedException"/> class.
1012 /// </summary>
1113 /// <param name="message">Error message.</param>
12- /// <param name="workflowId">Already started workflow ID.</param>
13- /// <param name="runId">Already started run ID.</param>
14+ /// <param name="workflowId">See <see cref="WorkflowId"/>.</param>
15+ /// <param name="runId">See <see cref="RunId"/>.</param>
16+ [ Obsolete ( "Use other constructor" ) ]
1417 public WorkflowAlreadyStartedException ( string message , string workflowId , string runId )
18+ : this ( message , workflowId , "<unknown>" , runId )
19+ {
20+ }
21+
22+ /// <summary>
23+ /// Initializes a new instance of the <see cref="WorkflowAlreadyStartedException"/> class.
24+ /// </summary>
25+ /// <param name="message">Error message.</param>
26+ /// <param name="workflowId">See <see cref="WorkflowId"/>.</param>
27+ /// <param name="workflowType">See <see cref="WorkflowType"/>.</param>
28+ /// <param name="runId">See <see cref="RunId"/>.</param>
29+ public WorkflowAlreadyStartedException (
30+ string message , string workflowId , string workflowType , string runId )
1531 : base ( message )
1632 {
1733 WorkflowId = workflowId ;
34+ WorkflowType = workflowType ;
1835 RunId = runId ;
1936 }
2037
@@ -24,7 +41,13 @@ public WorkflowAlreadyStartedException(string message, string workflowId, string
2441 public string WorkflowId { get ; private init ; }
2542
2643 /// <summary>
27- /// Gets the run ID that was already started.
44+ /// Gets the workflow type that was attempted to start.
45+ /// </summary>
46+ public string WorkflowType { get ; private init ; }
47+
48+ /// <summary>
49+ /// Gets the run ID that was already started. This may be <c><unknown></c> when this
50+ /// error is thrown for a child workflow from inside a workflow.
2851 /// </summary>
2952 public string RunId { get ; private init ; }
3053 }
0 commit comments