Results 1 to 2 of 2

Thread: java Ice.Exception, where is it?

  1. #1
    iamwoodyjones is offline Registered User
    Name: john smith
    Organization: blahblah
    Project: blahblah
    Join Date
    Sep 2006
    Location
    blah
    Posts
    7

    Question java Ice.Exception, where is it?

    Platform:
    Windows XP, Ice 3.1 Visual Studio 2005 version.


    Perhaps I'm missing something but I am not able to use the Ice.Exception with Java. It's saying that it does not exist. I have been able to use it with C++ and C# but it seems to be missing from the Java version.

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi,

    That's correct, the Java language mapping does not have Ice.Exception because we wanted user exceptions to derive from java.lang.Exception (and therefore be checked exceptions) whereas the Ice run time's local exceptions derive from java.lang.RuntimeException. If you want to catch all Ice exceptions or distinguish between user and local exceptions, you can structure your code as follows:
    Code:
    try
    {
        ...
    }
    catch(Ice.UserException ex)
    {
    }
    catch(Ice.LocalException ex)
    {
    }
    Otherwise, you can trap all exceptions by catching java.lang.Exception.

    Take care,
    - Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 08-20-2010, 06:22 AM
  2. exception chaining in Java
    By nefilim in forum Help Center
    Replies: 1
    Last Post: 03-04-2009, 06:18 PM
  3. Replies: 15
    Last Post: 07-29-2005, 10:18 PM
  4. unexpected exception outside java VM in Linux
    By teayu in forum Bug Reports
    Replies: 1
    Last Post: 11-13-2004, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •