Is it a good or bad idea throwing Exceptions when validating data?

后端 未结 14 953
你的背包
你的背包 2020-12-07 16:27

When validating data, I\'ve gotten into a habit of doing the following:

Note: I don\'t really have individual booleans for each check. This is just

14条回答
  •  长情又很酷
    2020-12-07 17:09

    I'm going to repeat the mantra here: throwing exceptions should be done in exceptional circumstances. Invalid entered data is really not that exceptional.

提交回复
热议问题