dcsimg
Exception to catch when reading a file and when application is crashing
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   AdiNarayana_Kolluru
Posted On:   Thursday, April 19, 2001 03:05 PM

What exception do I need to catch when I try to read a corrupt file to prevent application from crashing? I am using BufferedReader and FileReader to read a file and using ReadLine method.

Re: Exception to catch when reading a file and when application is crashing

Posted By:   Michael_Wax  
Posted On:   Thursday, April 19, 2001 09:19 PM

At the least, you need to catch the IOException declared by readLine, or your application won't compile. For debugging, you might want to wrap the file read operation in a try block and catch Throwable, i.e., everything, and see what exception is being generated by the corrupt file.
About | Sitemap | Contact