Results 1 to 3 of 3
Thread: URL error handling
- 01-15-2012, 03:46 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 28
- Rep Power
- 0
URL error handling
Hi,
I have a giant list of URL's and some connect to a website, and some give errors.
All I have is a throws IOExeption at the top of a method, and a try/catch FileNotFoundException for the URL connection.
The latest error that has come up is UnknownHostException. So my question is, how can a program be made to to handle multiple errors? Nested try/catch or is there another way?
Thanks
- 01-15-2012, 04:34 AM #2
Senior Member
- Join Date
- Feb 2010
- Location
- Waterford, Ireland
- Posts
- 748
- Rep Power
- 4
Re: URL error handling
Catch statements can come one after another...
Throwing an exception in the head of the function will request the calling function to deal with the exception.Java Code:try{ someOperation; }catch(IOException e){ e,printStackTrace()}; catch(Exception e{ e.printStackTrace(); }
- 01-15-2012, 04:36 AM #3
Member
- Join Date
- Aug 2010
- Posts
- 28
- Rep Power
- 0
Similar Threads
-
Handling Error Messages?
By DoubleDee in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 12-29-2011, 12:19 PM -
Error handling in servlet
By an24 in forum Java ServletReplies: 2Last Post: 12-21-2009, 06:40 PM -
[SOLVED] error handling
By jmHoekst in forum New To JavaReplies: 9Last Post: 07-07-2008, 10:46 PM -
How to use JDBC Template classes to control basic JDBC processing and error handling
By Java Tip in forum Java TipReplies: 0Last Post: 04-01-2008, 10:17 AM -
SQL error handling example
By Java Tip in forum Java TipReplies: 0Last Post: 02-12-2008, 09:38 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks