Is there a benefit to JUST a “throw” in a catch?

后端 未结 11 1239
醉梦人生
醉梦人生 2021-02-07 06:42

Been having a \"heated debate\" with a colleague about his practice of wrapping most of his functions in a try/catch but the catch has JUST a \"throw\" in it e.g.



        
11条回答
  •  走了就别回头了
    2021-02-07 07:00

    Since there is zero error handling, this catch is useless. If there was logging or some cleanup done sure, but in this situation I'd get rid of the try/catch.

提交回复
热议问题