wip
This commit is contained in:
parent
0dc41337da
commit
14fd359ea8
28 changed files with 156 additions and 52 deletions
7
Femto.Common/Domain/DomainError.cs
Normal file
7
Femto.Common/Domain/DomainError.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace Femto.Common.Domain;
|
||||
|
||||
public class DomainError : Exception
|
||||
{
|
||||
public DomainError(string message, Exception innerException) : base(message, innerException) {}
|
||||
public DomainError(string message) : base(message) {}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
namespace Femto.Common.Domain;
|
||||
|
||||
public class DomainException : Exception
|
||||
{
|
||||
public DomainException(string message, Exception innerException) : base(message, innerException) {}
|
||||
public DomainException(string message) : base(message) {}
|
||||
}
|
|
@ -16,6 +16,6 @@ public abstract class Entity
|
|||
protected void CheckRule(IRule rule)
|
||||
{
|
||||
if (!rule.Check())
|
||||
throw new RuleBrokenException(rule.Message);
|
||||
throw new RuleBrokenError(rule.Message);
|
||||
}
|
||||
}
|
||||
|
|
3
Femto.Common/Domain/RuleBrokenError.cs
Normal file
3
Femto.Common/Domain/RuleBrokenError.cs
Normal file
|
@ -0,0 +1,3 @@
|
|||
namespace Femto.Common.Domain;
|
||||
|
||||
public class RuleBrokenError(string message) : DomainError(message);
|
|
@ -1,3 +0,0 @@
|
|||
namespace Femto.Common.Domain;
|
||||
|
||||
public class RuleBrokenException(string message) : DomainException(message);
|
Loading…
Add table
Add a link
Reference in a new issue