One Exception handler for all exceptions of a CLASS

前端 未结 6 1647
甜味超标
甜味超标 2021-02-04 01:05

I have a class with number of methods and want to have one exception handler for them all. There are so many of these methods and they have different parameters, that it would b

6条回答
  •  故里飘歌
    2021-02-04 01:39

    Exceptions are not really class related but method/callstack oriented. An object should, in general, not try to handle exceptions from it's own methods. It's up to the callers of those methods.

提交回复
热议问题