티스토리 뷰

공부

[Java] re try catch

승가비 2021. 2. 9. 01:02
728x90
int MAX = 3;

int count = 0;
while (true) {
    try {
        ...

        break;
    } catch (Exception e) {
        if (count++ < MAX) {
            continue;
        }

        ...
        
        break;
    }
}

https://stackoverflow.com/questions/13239972/how-do-you-implement-a-re-try-catch

 

How do you implement a re-try-catch?

Try-catch is meant to help in the exception handling. This means somehow that it will help our system to be more robust: try to recover from an unexpected event. We suspect something might happen...

stackoverflow.com

 

728x90

'공부' 카테고리의 다른 글

[Java] NumberUtils.toInt(null) -> 0  (0) 2021.02.09
[SQL] LIKE subquery  (0) 2021.02.09
[Python] has key dict  (0) 2021.02.09
[Sh] date this sunday `date +%Y%m%d -d 'next sunday - 1 week'`  (0) 2021.02.03
[Java] StringUtils.repeat("asdf", 3)  (0) 2021.01.31
댓글