Throwing multiple exceptions in Java

后端 未结 11 1474
无人及你
无人及你 2020-12-28 13:04

Is there any way to throw multiple exceptions in java?

11条回答
  •  遥遥无期
    2020-12-28 13:51

    I suppose you could create an exception containing a list of caught exceptions and throw that exception, e.g.:

    class AggregateException extends Exception {
        List basket;
    }
    

提交回复
热议问题