Exception not being passed from remote client to local?

GravitasGravitas Member Shane TolmieOrganization: Software HouseProject: Server modules in C++, C# and Java, to client. ✭✭
I'm having a problem with exceptions not being passed from the remote client to the local client.

The slice definition is:
exception ExceptionIceGeneral
{
string Description;
};

The C# server sits behind a Glacier2 firewall, and throws an exception thus:
throw new ExceptionIceGeneral("New Exception");

The C# client tries to intercept the exception:
catch (ExceptionIceGeneral e)
{
Console.Write("Exception is: {0}.\n", e.Description);
}

However, the code above does not intercept this exception: instead, the following exception handler is invoked:
catch (System.Exception ex)
{
Console.Error.WriteLine(ex);
}

However, this handler does not contain the "Description", so there is no way to tell what caused the error (the client prints "Ice.UnknownUserException", there is no correct "Description" string anywhere in "ex").

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Shane,

    It would also help us to see the Slice definition of the operation that you're invoking.

    One simple explanation for this situation is neglecting to include ExceptionIceGeneral in the operation's throws clause. Another possibility is a mismatch between the Slice definitions in use by the client and server.

    Regards,
    Mark
  • GravitasGravitas Member Shane TolmieOrganization: Software HouseProject: Server modules in C++, C# and Java, to client. ✭✭
    The problem seems to be solved now.

    - The exceptions are making their way back to the client now. I think the problem was that I was catching the wrong exception which stripped out some of the exception information.
    - I added SmartInspect to the server, so the exceptions are being logged properly in any case.
Sign In or Register to comment.