Archived

This forum has been archived. Please start a new discussion on GitHub.

Problem with user-defined exception

Hi,

I have encountered somewhat strange situation while passing exceptions over the wire.

I'm using Ice-3.3.0-VC90 and C# 3.5

MFServerI ... a server waiting for notification from a client(ConverterServerI)
ConverterServerI ... a server acting as a client for MFServerI

MFServerI Slice:

module comm {
module servers {
module interfaces {

module MFServerI {

enum MFErrorEnumI {
SESSIONEXPIRED,
INTERNALERR
};

exception MFErrorI {
MFErrorEnumI errenum;
string errmsg;
};

interface ConverterNotification {
/**
* Conversion finished notification.
**/
void ConversionFinishedNtf(
string sessionid
)
throws MFErrorI;
};
}

}
}
}


When ConverterServerI finishes conversion it reports that to MFServerI by calling ConversionFinishedNtf.
If MFServerI throws an exception of type MFErrorI this is what I get on ConverterServerI's side:
Ice.UnknownUserException
unknown = "comm::servers::interfaces::MFServerI::MFErrorI"
at Ice.ObjectPrxHelperBase.handleExceptionWrapper__(ObjectDel_delegate, LocalExceptionWrapper ex, OutgoingAsync outAsync) in d:\builds\distbuilds\release\Ice-3.3.0\cs\src\Ice\Proxy.cs:line 905


If I omit MFErrorI as a known user exception from MFServerI's Slice:
interface ConverterNotification {
void ConversionFinishedNtf(
string sessionid
);
};


then if MFErrorI is thrown I get on ConverterServerI's side understandable:
Ice.UnknownUserException
unknown = "comm.servers.interfaces.MFServerI.MFErrorI"
errenum = SESSIONEXPIRED
errmsg = "testing exception"
at IceInternal.IncomingBase.handleException__(Exception exc) in d:\builds\distbuilds\release\Ice-3.3.0\cs\src\Ice\Incoming.cs:line 151"


I noticed dots where there were colons before in unknown field?


All communication use IceSSL and all is working ok unless exception is thrown.
I would appreciate some guidance if you could spare some time.

And of course - Thank you for exceptional Ice. I just discovered it and it is by far the best piece of comms software I've ever seen.

Best regards,
Gregor

Comments

  • benoit
    benoit Rennes, France
    Hi Gregor,

    In the first case, it's the client that detects the unexpected user exception. Most likely, this is caused by a Slice mismatch between the client & server. Did you perhaps compile the client with a Slice file where you didn't specify the exception for the ConversionFinishedNtf method?

    In the second case, it's the server which detects the unexpected user exception.

    In the first case, the unknown field contains the Slice ID of the user exception (comm::servers::interfaces::MFServerI::MFErrorI) and in the second case it contains the stringified user exception. It's a bit inconsistent... we'll look into changing this :)

    Cheers,
    Benoit.