How to implement top level exception handling?

前端 未结 5 1212
再見小時候
再見小時候 2020-12-31 17:19

I recently had to develop an additional module for an existing service developed by a colleague. He had placed a try/catch block in the main working function for catching al

5条回答
  •  旧时难觅i
    2020-12-31 18:11

    The urge to catch all exceptions and make the program 'stable' is very strong and the idea seems very enticing indeed to everyone. The problem as you point out is that this is just a ruse and the program may very well be buggy and worse, w/o indications of failures. No one monitors the logs regularly.
    My advice would be to try and convince the other developer to do extensive testing and then deploy it in production w/o the outer catch.

提交回复
热议问题