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.

}
 
Back
Top