Need authoritative source for why you shouldn't throw or catch java.lang.Exception

后端 未结 9 1091
无人及你
无人及你 2020-12-19 09:27

I\'ve got a coding standards meeting in just over an hour and I need a quick answer to this one.

Common wisdom among experienced Java programmers is that you don\'t

9条回答
  •  北海茫月
    2020-12-19 10:07

    If you have a copy of Josh Bloch's Effective Java to hand, I know he covers exception handling in a fair bit of detail there. I don't have access to it at present so I can't summarise it or give you page references, but I'm pretty sure he's got some good arguments for not catching java.lang.Exception.

提交回复
热议问题