Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int code = 4;
- Exception ex;
- try{
- load0(res0);
- someCodeHere();
- load1(res1);
- someOtherCodeHere();
- load2(res2);
- yetAnotherCodeHere();
- load3(res3);
- andYetAnotherCodeHere();
- }
- catch(EType0 e0){
- code = 0;
- ex = e0;
- }
- catch(EType1 e1){
- code = 1;
- ex = e1;
- }
- catch(EType2 e2){
- code = 2;
- ex = e2;
- }
- catch(EType3 e3){
- code = 3;
- ex = e3;
- }
- switch(code){
- case 4:
- unload3(res3);
- case 3:
- unload2(res2);
- case 2:
- unload1(res1);
- case 1:
- unload0(res0);
- case 0:
- break;
- }
- if(code < 4)
- throw new Exception("whatever happens lol", ex);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement