Is it possible to get back to the Try block from a Catch block?

I would like to perform validations on a config file. To do so, I have a method which will throw a MissingConfigException or an InvalidConfigException if something is missing or if something doesn't match a regex pattern. Although I have to do that with many different configs and I would like to go through all of them so that my error message will report all missing / incorrect configs at once instead of 1 at a time. Thus, I wanted to know if there would be any way I could do something like:
try {
     config.validate("ServerPort","\\d+");
     config.validate("MaxClients","\\d+");
} catch(MissingConfigException e) {
} catch(InvalidConfigException e) {
and have the catch block executed before going through the try block from where the exception was thrown.
Thanks in advance!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

No, you can't jump back into the try. You can put your try/catch inside a loop though, so that if one fails, it will loop around and start a new try for the next one. Define a class that holds all the data you need to pass to validate, and make an array or List of those objects. Change or add a validate signature that takes this object, or just extract the strings from each one when you call validate.
ThingToValidate[] val = new ThingToValidate[] { new ThingToValidate("ServerPort", "\\d+"),
    new ThingToValidate("MaxClients", "\\d+"),
for (int ix = 0; ix < val.length; ix++) {
    try {
        config.validate(val[ix]);
        // OR
        config.validate(val[ix].getThingy, val[ix].getOtherThingy[]);
    catch (....) {
        // logger.warn("failed...");

Similar Messages

  • Is it possible to get back all my icloud photos from different phones?

    My phone recently started not being able to back up due to icloud being full. Is there a way i can get all my photos back? I've had several phones but on the same account. thanks

    All of the files that you were working on and managing in Lightroom were not actually "in" Lightroom. Your files are stored in folders on your computer. Lightroom simply points to those files and displays them. Reinstalling Lightroom would not have any impact on your image files unless the hard drive(s) were reformatted in the process. Lightroom uses a catalog which is a database to keep track of where your images are located. It also stores all of the adjustments made to your images. If you backed up that catalog before reinstalling your software, and if you still have all of your images, then you should be able to open that catalog that you used previously and have all of your work still in place. If you don't have the catalog then I'm afraid you will just have to start over. Whether or not you still have your image files isn't clear.

  • How to get back all the uploaded iphotos from icloud after resting the macbook to its original settings

    Hi Team,
    I have reinstalled my Operating system  and prior to that ihave  uploaded my all the photos and videos to icloud from iphoto and now ,my mac book air is reinstalled and installed iphoto as well.. i could not see any photos in it,,
    is there a way to retrive them back
    Please help me out if there is a way.
    Thanks & Regards,
    Srinivas Talasila

    and prior to that ihave  uploaded my all the photos and videos to icloud from iphoto
    Which part of iCloud are you referring to? iCloud Drive? iCloud Photo Library Beta? My Photo Stream? Shared Photo Stream?

  • HT1689 I got switched to the Canadian store from the US one when looking for a specific song? How do I get back to the US store in my iPad app?

    How do I get back to the US store from the Canadian store? My iPad iTunes app now goes to the Canadian store

    Switching an iTunes Store account to a different country
    http://www.ilounge.com/index.php/articles/comments/switching-an-itunes-store-acc ount-to-a-different-country/
     Cheers, Tom

  • Hii all, I just bought an used iphone 5c from an user and only after a few weeks realised that it got activation locked. He might be unaware of that. Is it possible to get back to him and unlock the device for me as i have not contacts with him presently.

    Hii all, I just bought an used iphone 5c from an user and only after a few weeks realised that it got activation locked. He might be unaware of that. Is it possible to get back to him and unlock the device for me as i have not contacts with him presently.

    Well first you need to sync your iPhone 4 with your Mac/PC so that it will transfer all your music, apps, podcasts, etc. Then sync your iPod Touch and the media you selected during the sync should be there on your iPhone. If you have difficulty in transferring media from iPhone to your computer, try softwares like TransCopy. They will help in transferring data from your iphone to your computer. Dont forget to check that all the transferred data is in the iTunes media folder so that the iTunes can locate the files. Link to Transcopy software :
    http://www.copytrans.net/copytrans.php

  • Good evening would it be possible to get back a free license for one month for adobe photoshop cc because I went on vacation and I have not had the opportunity to test it?

    Good evening would it be possible to get back a free license for one month for adobe photoshop cc because I went on vacation and I have not had the opportunity to test it?

    Hi tay-fun@livefr,
    We apologize however it's not possible to reset the trial however you can try and use it on a different machine with a different Adobe ID (if possible).
    -Ankit

  • Since recent updates, I have noticed that my apps close automatically when I am distracted. In some cases it is time consuming to sign back in and get back to the task I was doing. Is it possible to change a setting so the apps will stay open?

    Since recent updates of iOS, I have noticed when using my iPad that my apps close automatically when I have to leave the room or am otherwise distracted for a few minutes. It is sometimes time consuming to sign back in and get back to the task where i left off. Is there a setting I can change so it will keep the apps open until I am ready to close them? Thanks for your help.

    Did you have this problem before Restoring you iPad?
    If you did then did you restore with a backup. You may have reinstalled something that is conflicting in this back up
    If not then sounds like either something went array with the clean install or a hardware issue.
    I know it's long winded but have you tired a clean install then downloading the apps again?
    PJRS

  • Is it possible to get back 2.0 version coz I've updated it to 3.0...

    Is it possible to get back 2.0 version coz I've updated it to 3.0 and I'm not happy with it. The new features are cool and all but the thing is, the battery drains quickly. And who would want that? I'll be satisfied having the older version back if that's the case.
    Before updating my iPhone to it's latest version, the battery is not that easy to drain. But ever since I updated it to 3.0 version software, my iPhone does not even last for a day. WELL GETTING TO MY MAIN POINT, IS IT POSSIBLE TO GET THE OLD SOFTWARE VERSION WHICH IS 2.0? Please if you have any idea to answer my question, please do so. And tell me how and what to do. Thanks.
    Message was edited by: Alyssabeybeh=))

    I've experience the EXACT same problem. Apple Support didn't believe the battery draining coincided with the 3.0 upgrade. I've tried evverything. Apple was awesome in that they replaced myt previous iPhone. Problem is, the exact same problem persists. I've turned off all wireless except GSM. I've removed all apps. I've reduced brightness to nearly nothing. Still, the battery drains within 4 hours. I'm on my way back to the Genius bar today.

  • Is this possible to get back in ios 6.1.3 from ios 7.04?

    Is this possible to get back in ios 6.1.3 from ios7 ?

    Apple does not support downgrading the iOS. If there are edifice areas that are causing you problems you should ask about them on these forums and someone might be able to help. Let us know exactly what the problem is, what you might have done to correct it, and what, if any, error messages you received.

  • How can I get back to the future?

    I have a 15" MacBook Pro running 10.6.8.  Last night I upgraded to Lion and honest to goodness I'd rather have a Windows PC.  I have only to programs for which I use a computer -- Adobe PhotoShop CS2 and Bible software,for both of which I paid near $600 -- neither of which are supported in Lion.  Is it possible to get back to 10.6.8 without loosing everything on my hard drive?  Thank you kindly.

    As far as I know, Apple mail itself is not directly compatible between 10.7 and 10.6.   This gives you a couple options.  You could:
    1. Buy an external hard drive, partition it for room, install 10.6 onto it, and install Photoshop, your Bible program, and use 10.7 for everything else on your internal, and a second partition act as an exact clone of your internal.     You will probably need to contact Adobe to register your external hard drive as the registration code for its Photoshop.  Partitioning is described here: http://docs.info.apple.com/article.html?artnum=61301   
    Cloning is described on my FAQ*:
    http://www.macmaps.com/backup.html
    Lastly, I'd make a second clone of the first to ensure you don't lose data in the future, and manage both clones.
    2. More complicated would be to export your applications to all 10.6 compatible formats.  Mail would have to be copied to an IMAP account.    Addressbook exported to vCard.  iTunes and Office are thankfully already compatible. Once that is all setup, you would clone your machine twice.  Next you'd erase and install 10.6.   You'd then copy your Users -> yourname -> Music folder from the backup, and the Users -> yourname -> Documents folder on your backup to your 10.6 Users -> yourname folder, and copy the supporting preferences of Photoshop, and your bible program to the relevant folders.   Lastly you'd open Photoshop and work with Adobe on reregistering your Photoshop to your 10.6 machine.   In the future always keep at least two clones of your data before installing any updates, and read the tips on upgrading like those on my FAQ*:
    http://www.macmaps.com/upgradefaq.html

  • I had to manually download the new version of itunes.. via tools, it gave me 4 items to download and i did not download all 4 compenants.  Does anyone know how to get back to the pop up that contains tools so i can redownlaod all of them.

    I lost my old iphone and have a new 5s.. i need to sync to itunes.  i had to donwload manually via tools but i didnt download all four files.  now when i plug my phone into itunes it says there is an error bc i didnt download all the files.  so when i go into itunes now and check for updates it says its up to date.  the problem is with the phone support file i didnt download. 
    Does anyone know how to get back to the pop up that has the music player update and itunes update bc this is the only place i have seen "tools" to be able to manually update all four files....
    ***IF i completely uninstall itunes and reinstall will it still have all my songs, photos, apps etc... bc i need to sync my new phone to get all my stuff back

    this is a follow up from the profane post earlier....
    i have done this twice in two other posts..
    here is my problem.. i started off trying to update itunes, it failed twice and said i needed to install manually via tools.
    the only place to get to tools is the pop up box that appears when you click check for updates.. if there is an available update then the pop up shows up with the quick time and itunes files to download. so i finally figured that out. i clicked on tools and manual update, four files were saved to a file. Apple mobile device support, another one similar, itunes, and another one i cant remember. I only downloaded the itunes file seeing as though thats all i needed to accomplish in the first place.
    so then i restarted my computer bc you need to reboot and then reopen itunes for update to take effect. once i have itunes back open i plugged in my new 5s which i am trying to sync to my computer to get all my stuff back bc i lost my previous phone over the weekend.. once i plugged the phone in an error stating i needed to unistall the apple mobile device support and itunes and then reinstall. well i dont know where those files were originally stored on my computer AND since my itunes was updated, just not the other 3 associated files, when i click check for updates it says its up to date and then pop up containing the quick time and itunes does not pop up thus i cant get back to the tools tab to manually save the 4 files again.
    so i was just going to uninstall itunes all together and then i thought well what happens if it erases all my photos apps songs etc... which would defeat the whole purpose in the first place of me trying to sync my new phone to get all my stuff back.
    so i literally have no idea what to do at this point.. if you have read this you are probably just as confused as me...

  • HT1918 i want to get back to the us store on my apple id it keep saying that I'm in a french store how do you get it back to normal

    i cant get no apps how do i get back to us store

    Sign out from your account and then sign in back. You should be able to refresh your account and go back to the correct iTunes Store.

  • HT4463 How do I get back to the same page I was on?

    When I have finished reviewing an app, if I click the back arrow in the top left corner it takes me back to the first page of the category. Not very user friendly when there are dozens of pages to click through to get back to where you were. How do I get back to the same page I was on?

    This is what I mean:  The users guide gives me all these instructions.  BUT, it does not give instructions to just STOP.  I don't
    Pause a song
    Tap .
    Resume playback
    Tap .
    Raise or lower the volume
    Drag the onscreen volume slider or use the iPad volume buttons.
    Restart a song or a chapter in an audiobook or podcast
    Tap .
    Skip to the next song or chapter in an audiobook or podcast
    Tap .
    Go to the previous song or chapter in an audiobook or podcast
    Tap twice.
    Rewind or fast-forward
    Touch and hold or —the longer you hold the control, the faster the song rewinds or fast-forwards.
    View album art full-size
    Tap the album cover when playing a song.
    I don't want to pause, resume playback, restart or any of these things.  i just want to STOP.  How do I do that?

  • IPhone 4s call waiting; how do I get back to the first call?

    When I'm on a call and a second call comes in I tap "hold current call and answer." I get connected to the second call and the first call is put on hold. But when I am done with the second call, how do I get back to the first call? I can't find any way to get back to the call that is on hold. I usually end up hanging up on both calls. Not good.
    Also, how do I switch back and forth between two calls? How do I put the second call on hold, go back to the first call to tell that person I must call them back, then return to the second call?

    http://support.apple.com/kb/TA38607?viewlocale=en_US
    Good Luck

  • How do I get back to the first page of an application when I'm in the middle of it?

    I'm sure there's an easy answer for this, but I can't find it.  If I'm in the middle of an application, say iBook, and I want to get back to the first page of that application, how do I do it?  When I tap on HOME, I go back to the home page with all the icons.  I want to go to another page within the application I'm in?  I've been stuck in iBook for an hour.....I don't know how to get back to the first page in that application.  Thanks.

    The shelves should show the ibooks that you've got in the app i.e. your downloaded purchases from the iBookstore. At the top of the shelves there should also be a Store button (for browsing, purchasing, re-downloading books from the iBookstore), and Collections (where any PDFs that you've synced/copied into the app go).
    There is a chapter on the iBooks app in the manual, which can be downloaded from here http://support.apple.com/manuals/#ipad

Maybe you are looking for

  • How can I edit text in a tagged PDF?

    I have created an accessible test form in Acrobat Pro X.  Now that it has all been tagged and reading order touched up, the client wants to change the text.  Is there any way to edit text at this point or do I have to create an entirely new tagged ac

  • A205-S5871 STUCK ON TOSHIBA SCREEN

    I've taken my laptop to a Toshiba A/S center 2 times already after doing numerous recoveries myself and told them I had a really bad virus.  The Tech didn't open up my laptop both times and just did a system recovery and said there's nothing wrong wi

  • My tool bar and Layers pallet are behind my free floating files how do I get them on top?

    I have been a Photoshop CS user for about 13 years...I recently downladed CS5 to try it before I buy it. I've been a CS3 user for 3 or 4 years now. I love Photoshop but other than Photoshop I am not a very savvy computer user. So please bear with me

  • How to use Java Beans in Oracle Forms 11g at 64 bit windows7

    Hello Experts,               I am using Oracle forms 11.1.2.2.0 with weblogic 10.3.6 generic at windows 7 64 bit. My java version is jdk1.7.0_51. Now I have a htmlbutton.jar (which is for bean item in oracle form and this jar file works well for orac

  • ITunes 8 Won't Open mp3s

    In Finder, when I try to open an mp3 with iTunes through the "open with" pulldown menu, iTunes seems to flicker but no music appears in my Library. Is this a glitch in 8?