Archived

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

Exception not being passed from remote client to local?

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

  • mes
    mes California
    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
  • 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.