Thread: Exception handling

  1. #16
    Registered User
    Join Date
    Jul 2007
    Posts
    21
    Yes, actually, it does throw an exception. It is however a "java.io.IOException" because the C++ program is interfacing with the Java classes that in turn interface with the device. I don't know how specificially but I know that they do. My C++ program cannot catch a java exception. A horrifying nightmare caused by people who refuse to accept the fact that there are multiple programming languages out there...not just java

  2. #17
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Well this certainly puts a whole new spin on this advice: "Don't allow exceptions to propagate across module/subsystem boundaries"

    BTW, Java has something called JNI (Java Native Interface) that allows communication between native code and Java classes. I've never used it though, so you'll have to look it up yourself.
    I'd recommend fixing the 'driver' by writing a Java adapter around all the public functions that catches & translates any exceptions that are thrown into standard C error codes... Then your C++ code don't need to worry about exceptions anymore.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. signal handling and exception handling
    By lehe in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2009, 10:01 PM
  2. Exception handling in a large project
    By EVOEx in forum C++ Programming
    Replies: 7
    Last Post: 01-25-2009, 07:33 AM
  3. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 05:28 PM
  4. is such exception handling approach good?
    By George2 in forum C++ Programming
    Replies: 8
    Last Post: 12-27-2007, 08:54 AM
  5. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 02:36 PM