it's not possible to catch exceptions that are not defined locally, for
obvious reasons.
when the exception class is not available on the client, a GenericException
will be raised:
https://github.com/tomerfiliba/rpyc/blob/master/rpyc/core/vinegar.py#L157

you can import it and use

try:
    foo()
except GenericException as ex:
    if type(ex).__name__ == "the.remote.module.ExceptionClass":
        handle_it()
    else:
        raise


hope this gets you going

-----------------------------------------------------------------

*Tomer Filiba*
tomerfiliba.com     <http://www.facebook.com/tomerfiliba>
<http://il.linkedin.com/in/tomerfiliba>



On Tue, Aug 21, 2012 at 1:05 AM, kitc <[email protected]> wrote:

> Hi all,
>
> Is it possible to catch exceptions that are only defined remotely when
> using the classic server?
>
> For example:
>
> Remote Server running rpyc classic server:
> failure.py <-- remote exception class
>
> Local Machine:
> c = rpyc.classic.connect( ... )
> failure = c.modules.failure
>
> try:
>     ...
> except failure.Failure as f:
>     print f
>
> Thanks for your help,
> Kit
>
>
>
>

Reply via email to