error-or
error-or copied to clipboard
Suggestion: Adding of ErrorType.Domain (or ErrorType.UseCase or ErrorType.BusinessRule)
Hi @amantinband , Thank you very much for developing this library. Got to know about it from your video series. Let me know your thoughts on adding a special error type ErrorType.Domain to represent errors related specific to business rules instead of just ErrorType.Custom. This is because, if its an Error it indeed means a type of Failure so instead of just ErrorType.Failure if we use ErrorType.Domain, it signifies failure in some use case / business rule validation. Example, consider this business rule: User cannot add/upload more than 3 products to sell under his/her current FREE subscription. Can you please share your thoughts on this.
Hi, you can use the NumericType
property on Error
with ErrorType.Custom
. Then you can have your enum with other types of errors, like Domain
, BusinessRule
, etc.
Then you can check the error NumericType
against this enum.
Thank you @vpekarek. Recently realized it.