Home Help Center

Throws Exception~

Server throws a exception(defined in a SLICE), and client catches it, is it right? If does server have to catch the exception? Thanks a lot!

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Please see [thread=1697]this thread[/thread] for our support policy.

    Benoit.
  • thelONEthelONE Member
    I'm very Sorry, I did not know that policy before.
    i have edited my signature.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Thanks for completing your signature. To answer your first question, yes, the client will receive the exception raised by a servant if this exception is correctly defined in the Slice. Take a look at the manual for information on catching and raising exceptions, it's explained for each langague mapping, for example in section 6.13 and 8.6 for the C++ mapping. I'm not sure I understand your second question.

    Benoit.
  • thelONEthelONE Member
    /**
    Thanks for completing your signature. To answer your first question, yes, the client will receive the exception raised by a servant if this exception is correctly defined in the Slice. Take a look at the manual for information on catching and raising exceptions, it's explained for each langague mapping, for example in section 6.13 and 8.6 for the C++ mapping. I'm not sure I understand your second question.
    */

    ^_^ Thank you! I think i understand it.
    That is said, I don't need to catch exceptions throwed in server process, they will be catched by ICE runtime, and ICE runtime passes them to the client process, finally ICE runtime in client process re-throws those exceptions in client process?
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Yes, that's how it works. You just need to raise the exception in your servant method implementation and it will transparently be transmitted over the wire by the Ice runtime to your client.

    Benoit.
  • thelONEthelONE Member
    Thank you! :)
Sign In or Register to comment.