Uncatchable exception?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Uncatchable exception?

  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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center