-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UnexpectedStateException dry'ing & refactoring
- Loading branch information
Showing
10 changed files
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
Core/Cleipnir.ResilientFunctions/Domain/Exceptions/UnexpectedFunctionState.cs
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
Core/Cleipnir.ResilientFunctions/Domain/Exceptions/UnexpectedStateException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using Cleipnir.ResilientFunctions.CoreRuntime; | ||
|
||
namespace Cleipnir.ResilientFunctions.Domain.Exceptions; | ||
|
||
public sealed class UnexpectedStateException : FlowTypeException | ||
{ | ||
public FlowId FlowId { get; } | ||
|
||
public UnexpectedStateException(FlowId flowId, string message) | ||
: base(flowId.Type, message) => FlowId = flowId; | ||
|
||
public UnexpectedStateException(FlowId flowId, string message, Exception innerException) | ||
: base(flowId.Type, message, innerException) => FlowId = flowId; | ||
|
||
public static UnexpectedStateException NotFound(FlowId flowId) => new(flowId, $"{flowId} was not found"); | ||
public static UnexpectedStateException EpochMismatch(FlowId flowId) => new(flowId, $"{flowId} did not have expected epoch at restart"); | ||
public static UnexpectedStateException LeaseUpdateFailed(FlowId flowId) => new(flowId, $"{nameof(LeaseUpdater)} failed to update lease for '{flowId}'"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters