~ubuntu-branches/debian/sid/pyro/sid

« back to all changes in this revision

Viewing changes to Pyro/errors.py

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz, Sandro Tosi, Bernd Zeimetz
  • Date: 2009-05-25 14:26:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090525142623-31cqgb2pdff6c1az
Tags: 3.9.1-1
[ Sandro Tosi ]
* debian/control
  - switch Vcs-Browser field to viewsvn

[ Bernd Zeimetz ]
* New upstream release.
* debian/patches/usr-bin-env-location.dpatch:
  - Dropping patch, applied usptream. 
* debian/control, debian/rules:
  - Dropping dpatch build-dep and include, not needed anymore. 
* Switching to python-support and dh 7.
* Bumping Standards-Version to 3.8.1. 
* Dropping maintainer scripts, dh creates them properly. 
* Adding missing ${misc:Depends}. 
* Fix several file permissions in the examples package.
* Add symlink to the actual docu in pyro-examples. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#############################################################################
2
2
#
3
 
#       $Id: errors.py,v 2.19 2007/02/10 23:38:05 irmen Exp $
 
3
#       $Id: errors.py,v 2.19.2.3 2008/05/17 09:56:01 irmen Exp $
4
4
#       Pyro Exception Types
5
5
#
6
6
#       This is part of "Pyro" - Python Remote Objects
8
8
#
9
9
#############################################################################
10
10
 
11
 
 
12
11
#############################################################################
13
12
# PyroError is the Pyro exception type which is used for problems WITHIN Pyro.
14
13
# User code should NOT use it!!
62
61
#
63
62
#############################################################################
64
63
 
 
64
import Pyro.constants
 
65
 
65
66
class PyroExceptionCapsule:
66
67
        def __init__(self,excObj,args=None):
67
68
                self.excObj = excObj
68
69
                self.args=args  # if specified, this is the remote traceback info
69
70
        def raiseEx(self):
70
 
                # Modify the exception object to append some extra info to the message.
71
 
                # NOTE: using 'args' is not recommended (deprecated) as written in
72
 
                # the Python 2.5 manual (exception chapter)...
73
 
                import Pyro.constants
74
 
                if isinstance(self.excObj, Exception):
75
 
                        if not hasattr(self.excObj, "Pyro_traceback_set"):
76
 
                                self.excObj.Pyro_traceback_set = True
77
 
                                args=list(self.excObj.args) or []
78
 
                                args.append("This error occured remotely (Pyro). Remote traceback is available.")
79
 
                                self.excObj.args=tuple(args)
80
71
                setattr(self.excObj,Pyro.constants.TRACEBACK_ATTRIBUTE,self.args)
81
72
                raise self.excObj
82
73
        def __str__(self):
89
80
                        return s+': '+str(self.args)
90
81
        def __getitem__(self, i):
91
82
                return self.args[i]     
92