/usr/share/doc/pyro/examples/exceptions/client.py is in pyro-examples 1:3.14-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/env python
import sys, os
sys.path.insert(0,os.pardir) # to find testclient.py
import testclient
import Pyro.util
from excep import MyError
test = testclient.getproxy('exceptions')
print test.div(2.0,9.0)
try:
print 2/0
except ZeroDivisionError,x:
print 'DIVIDE BY ZERO',x
try:
print test.div(2,0)
except ZeroDivisionError,x:
print 'DIVIDE BY ZERO',x
try:
result=test.error()
print repr(result),result
except ValueError,x:
print 'VALUERROR',x
try:
result=test.error2()
print repr(result),result
except ValueError,x:
print 'VALUERROR',x
try:
result=test.othererr()
print repr(result),result
except MyError,x:
print 'MYERROR',x
try:
result=test.othererr2()
print repr(result),result
except MyError,x:
print 'MYERROR',x
print '*** invoking server method that crashes, catching traceback ***'
try:
print test.complexerror()
except Exception,x:
print 'CAUGHT ERROR, printing Pyro traceback >>>>>>',x
print ''.join(Pyro.util.getPyroTraceback(x))
print '<<<<<<< end of Pyro traceback'
print '*** invoking server method that crashes, not catching anything ***'
print test.complexerror()
|