Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 10-21-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
Mapping Exception

Hi,

it would be nice to have the possibility to specify exceptions that
represent general runtime errors at object implementation level that,
in Java, would be derived from java.lang.RuntimeException.

Consider the following:

module sample {

// marked somehow to derive from
// java.lang.RuntimeException, unchecked keyword ??
exception SystemError {
string message;
}

exception OutOfMemoryError extends SystemError {
}


interface RemoteService {

void doSomething(); // no throws clause for SystemError
}

}

Two benefits: first you don't have the add "throw SystemError" to all
the operations of an interface; second, the client is not aware of
implementation details in the normal case (it is aware only of
"logic" errors).

Regards,
Guido.
Reply With Quote
  #2 (permalink)  
Old 02-14-2008
domak domak is offline
Registered User
 
Name: Christophe Domas
Organization: Christophe Domas Consultant
Project: none
 
Join Date: Feb 2008
Posts: 1
Hi,
I'm also interested by this.
We have a lot of slices already defined without exception (ok, that's bad). Actually, clients catch UnknownException (ok, that's worst).
I would like to introduce a new exception hierarchy without modifying the slices, by throwing RuntimeException.

Is it possible?
Reply With Quote
  #3 (permalink)  
Old 02-14-2008
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,780
No, this is not possible. Ice has to know about the exceptions that can be raised (i.e., exceptions must be defined in Slice), otherwise it cannot know how to marshal them.

We might add the option for the user to define runtime exceptions in a future version of Ice, but these would have to be defined in Slice as well. The only difference to user exceptions would be that these are "unchecked" exceptions, i.e., they would not have to appear in the throws clause of operations. (Note that this would be a very intrusive change to Ice, so while it is on our todo list, don't expect this anytime soon.)

Having said this, I don't think such runtime exceptions should be used where user exceptions (exceptions listed in the throws clause of operations) are more appropriate.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which language mapping(s) do you use? marc Comments 12 05-31-2006 06:19 AM
Dictionary mapping in cpp DeepDiver Comments 1 04-07-2005 08:06 AM
C mapping colding Comments 4 03-31-2005 04:48 AM
Dummy c# mapping question stephan Help Center 5 02-27-2005 10:49 PM
OR mapping questions stephan Help Center 2 02-04-2005 03:42 PM


All times are GMT -4. The time now is 07:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.