Handling Exceptions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I handle IO exceptions, I have a project where I look in folder and
when a file appears it will upload it to the internet. But if the file is not
ready to be uploaded cause the other program is still using it, my program
will crash with an IOException. I want it so that when this exception occurs
it will pause for a couple of seconds then try again. Is this possiable?
 
Wrap what you want to do in a Try Catch Block


try{

//code that will throw an exception

}
catch(IOException e){

// code that will cause delay and try again.

}
 
Thank you I will try that.


Eric W said:
Wrap what you want to do in a Try Catch Block


try{

//code that will throw an exception

}
catch(IOException e){

// code that will cause delay and try again.

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top