Passing an exception up the calling chain

后端 未结 3 1493
迷失自我
迷失自我 2021-02-06 15:30

Was hoping for an explanation as to what it means to pass an exception up the calling chain by declaring the exception in my methods throws clause and why I would want to do tha

3条回答
  •  梦如初夏
    2021-02-06 15:52

    First, you'll have to add throws ABException to the main method and then either delete the block that catches the exception or rethrow it after logging

    throw ab;
    

提交回复
热议问题