DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    2

    Uncatchable exception?

    Why would I not be able to catch an exception?

    Specifically, when using the javax.xml.parsers.SAXParser package to open a URI with an invalid hostname (eg "www.w3.or" -- note the missing "g"), I get a java.net.UnknownHostException.

    All well and good. But I can't catch it in the top-level invoking function. It travels right past my my catch (java.net.UnknownHostException uhe), past my catch( Throwable t ), past my main(), and the call stack is printed out by the VM (1.4.1_01, running under Win2K).

    Any thoughts?

    Michael

  2. #2
    Join Date
    Mar 2003
    Posts
    834

    Thumbs down

    You've got your flow control wrong - it's perfectly catchable.
    ArchAngel.
    O:-)

  3. #3
    Join Date
    Oct 2003
    Posts
    2
    Aha. Too much debugging code, not enough thought. I was doing a universal catch in an inner function, and then calling System.exit(). Not helpful.

    Thanks for letting me bounce this off you.

    Michael

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links