~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/archiveuploader/nascentupload.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-26 16:35:37 UTC
  • mfrom: (13995.1.6 add-longpoll)
  • Revision ID: launchpad@pqm.canonical.com-20110926163537-o17y6ic6g9i3g943
[r=julian-edwards][no-qa] Upgrade txlongpoll version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
PARTNER_COMPONENT_NAME = 'partner'
50
50
 
51
51
 
 
52
class FatalUploadError(Exception):
 
53
    """A fatal error occurred processing the upload; processing aborted."""
 
54
 
 
55
 
52
56
class EarlyReturnUploadError(Exception):
53
57
    """An error occurred that prevented further error collection."""
54
58
 
110
114
    def from_changesfile_path(cls, changesfile_path, policy, logger):
111
115
        """Create a NascentUpload from the given changesfile path.
112
116
 
113
 
        May raise UploadError due to unrecoverable problems building
 
117
        May raise FatalUploadError due to unrecoverable problems building
114
118
        the ChangesFile object.
115
119
 
116
120
        :param changesfile_path: path to the changesfile to be uploaded.
117
121
        :param policy: the upload policy to be used.
118
122
        :param logger: the logger to be used.
119
123
        """
120
 
        changesfile = ChangesFile(changesfile_path, policy, logger)
 
124
        try:
 
125
            changesfile = ChangesFile(changesfile_path, policy, logger)
 
126
        except UploadError, e:
 
127
            # We can't run reject() because unfortunately we don't have
 
128
            # the address of the uploader to notify -- we broke in that
 
129
            # exact step.
 
130
            # XXX cprov 2007-03-26: we should really be emailing this
 
131
            # rejection to the archive admins. For now, this will end
 
132
            # up in the script log.
 
133
            raise FatalUploadError(str(e))
121
134
        return cls(changesfile, policy, logger)
122
135
 
123
136
    def process(self, build=None):