| | | 1 | | namespace AsyncResponse; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Thrown out of an <see cref="IDurableFlowContext"/> call when <em>this execution attempt</em> of |
| | | 5 | | /// a flow was interrupted — not when the step, or the run, failed: |
| | | 6 | | /// <list type="bullet"> |
| | | 7 | | /// <item>the run parked (a durable timer or a child flow suspended it; its wake-up is already |
| | | 8 | | /// published and the next delivery replays from the checkpoints);</item> |
| | | 9 | | /// <item>the host is stopping while the run was parked in process on a timer or an awaited |
| | | 10 | | /// response (the delivery is handed back to the worker transport and redelivered after the |
| | | 11 | | /// restart; the step's checkpoint is left untouched, so the replay waits out the remainder or |
| | | 12 | | /// re-attaches to the same correlation id).</item> |
| | | 13 | | /// </list> |
| | | 14 | | /// <para> |
| | | 15 | | /// Nothing went wrong with the work, so flow code must let it propagate: a catch-all that treats |
| | | 16 | | /// it as a step failure runs compensation — or throws <see cref="DurableFlowFailedException"/> and |
| | | 17 | | /// terminally fails the run — because of a deploy. It derives from |
| | | 18 | | /// <see cref="OperationCanceledException"/>, so the usual |
| | | 19 | | /// <c>catch (Exception ex) when (ex is not OperationCanceledException)</c> filter already excludes |
| | | 20 | | /// it, together with the caller-token cancellations that mean the same thing ("stop this |
| | | 21 | | /// execution", never "the step failed"). |
| | | 22 | | /// </para> |
| | | 23 | | /// </summary> |
| | | 24 | | public class DurableFlowInterruptedException : OperationCanceledException |
| | | 25 | | { |
| | | 26 | | /// <summary>Creates the exception with an operator-facing message.</summary> |
| | 208 | 27 | | public DurableFlowInterruptedException(string message) : base(message) |
| | | 28 | | { |
| | 208 | 29 | | } |
| | | 30 | | |
| | | 31 | | /// <summary>Creates the exception wrapping the cancellation (or other signal) that interrupted the attempt.</summar |
| | 4 | 32 | | public DurableFlowInterruptedException(string message, Exception? innerException) : base(message, innerException) |
| | | 33 | | { |
| | 4 | 34 | | } |
| | | 35 | | } |