Skip to content

Commit 0720922

Browse files
committed
save
1 parent aeb7c6e commit 0720922

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/ScheduledTasks/Exception/ScheduleClientValidationException.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ public ScheduleClientValidationException(string scheduleId, string message)
1919
this.ScheduleId = scheduleId;
2020
}
2121

22+
/// <summary>
23+
/// Initializes a new instance of the <see cref="ScheduleClientValidationException"/> class.
24+
/// </summary>
25+
/// <param name="scheduleId">The ID of the schedule that failed validation.</param>
26+
/// <param name="message">The validation error message.</param>
27+
/// <param name="innerException">The exception that is the cause of the current exception.</param>
28+
public ScheduleClientValidationException(string scheduleId, string message, Exception innerException)
29+
: base($"Validation failed for schedule '{scheduleId}': {message}", innerException)
30+
{
31+
this.ScheduleId = scheduleId;
32+
}
33+
2234
/// <summary>
2335
/// Gets the ID of the schedule that failed validation.
2436
/// </summary>

src/ScheduledTasks/Exception/ScheduleInvalidTransitionException.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ public ScheduleInvalidTransitionException(string scheduleId, ScheduleStatus from
2424
this.OperationName = operationName;
2525
}
2626

27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="ScheduleInvalidTransitionException"/> class.
29+
/// </summary>
30+
/// <param name="scheduleId">The ID of the schedule on which the invalid transition was attempted.</param>
31+
/// <param name="fromStatus">The current status of the schedule.</param>
32+
/// <param name="toStatus">The target status that was invalid.</param>
33+
/// <param name="operationName">The name of the operation that was attempted.</param>
34+
/// <param name="innerException">The exception that is the cause of the current exception.</param>
35+
public ScheduleInvalidTransitionException(string scheduleId, ScheduleStatus fromStatus, ScheduleStatus toStatus, string operationName, Exception innerException)
36+
: base($"Invalid state transition attempted for schedule '{scheduleId}': Cannot transition from {fromStatus} to {toStatus} during {operationName} operation.", innerException)
37+
{
38+
this.ScheduleId = scheduleId;
39+
this.FromStatus = fromStatus;
40+
this.ToStatus = toStatus;
41+
this.OperationName = operationName;
42+
}
43+
2744
/// <summary>
2845
/// Gets the ID of the schedule that encountered the invalid transition.
2946
/// </summary>

0 commit comments

Comments
 (0)