How to continue program execution even after throwing exception?

前端 未结 5 1413
盖世英雄少女心
盖世英雄少女心 2021-02-05 23:56

I have a requirement where in program execution flow should continue even after throwing an exception.

for(DataSource source : dataSources) {
    try {
        /         


        
5条回答
  •  耶瑟儿~
    2021-02-06 00:12

    No, there is no language support for handling an exception and then jumping back to the statement that caused it. You have to wrap separate try...catch constructs around every subsequence of operations that should execute even if the previous subsequence threw an exception.

提交回复
热议问题