mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-07 16:18:57 +00:00
18 lines
543 B
C#
18 lines
543 B
C#
|
|
namespace ProposalSystem.Application.Common;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Business-rule violation carrying a machine-readable code, surfaced as
|
||
|
|
/// 422 ProblemDetails with a top-level "code" extension (SHOC error-code
|
||
|
|
/// vocabulary convention — e.g. "CancelNotAllowed"). Clients branch on the
|
||
|
|
/// code, never on the human-readable message.
|
||
|
|
/// </summary>
|
||
|
|
public class BusinessRuleException : Exception
|
||
|
|
{
|
||
|
|
public string Code { get; }
|
||
|
|
|
||
|
|
public BusinessRuleException(string code, string message) : base(message)
|
||
|
|
{
|
||
|
|
Code = code;
|
||
|
|
}
|
||
|
|
}
|