Should a business rule violation throw an exception?

后端 未结 14 934
误落风尘
误落风尘 2021-02-04 04:18

Should a business rule violation throw an exception?

14条回答
  •  执笔经年
    2021-02-04 04:58

    There is good guidance in the wiki for the book 97 Things Every Project Manager Should Know, in particular in the chapter Distinguish Business Exceptions from Technical.

    So, if your programming language supports it, the best thing is to create custom exception classes so the their workflow and handling can be different from technical exceptions.

提交回复
热议问题