mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-01 00:45:52 +00:00
Change "UploadHappinessError" to "UploadUnhappinessError"
This commit is contained in:
parent
68fb556e93
commit
8bcc771e26
@ -11,7 +11,7 @@ from allmydata.util import mathutil, hashutil, base32, log
|
||||
from allmydata.util.assertutil import _assert, precondition
|
||||
from allmydata.codec import CRSEncoder
|
||||
from allmydata.interfaces import IEncoder, IStorageBucketWriter, \
|
||||
IEncryptedUploadable, IUploadStatus, UploadHappinessError
|
||||
IEncryptedUploadable, IUploadStatus, UploadUnhappinessError
|
||||
|
||||
|
||||
"""
|
||||
@ -495,7 +495,7 @@ class Encoder(object):
|
||||
msg = "lost too many servers during upload (still have %d, want %d): %s" % \
|
||||
(len(servers_left),
|
||||
self.servers_of_happiness, why)
|
||||
raise UploadHappinessError(msg)
|
||||
raise UploadUnhappinessError(msg)
|
||||
self.log("but we can still continue with %s shares, we'll be happy "
|
||||
"with at least %s" % (len(servers_left),
|
||||
self.servers_of_happiness),
|
||||
@ -505,12 +505,12 @@ class Encoder(object):
|
||||
d = defer.DeferredList(dl, fireOnOneErrback=True)
|
||||
def _eatNotEnoughSharesError(f):
|
||||
# all exceptions that occur while talking to a peer are handled
|
||||
# in _remove_shareholder. That might raise UploadHappinessError,
|
||||
# in _remove_shareholder. That might raise UploadUnhappinessError,
|
||||
# which will cause the DeferredList to errback but which should
|
||||
# otherwise be consumed. Allow non-UploadHappinessError exceptions
|
||||
# otherwise be consumed. Allow non-UploadUnhappinessError exceptions
|
||||
# to pass through as an unhandled errback. We use this in lieu of
|
||||
# consumeErrors=True to allow coding errors to be logged.
|
||||
f.trap(UploadHappinessError)
|
||||
f.trap(UploadUnhappinessError)
|
||||
return None
|
||||
for d0 in dl:
|
||||
d0.addErrback(_eatNotEnoughSharesError)
|
||||
|
@ -17,7 +17,7 @@ from allmydata.util.assertutil import precondition
|
||||
from allmydata.util.rrefutil import add_version_to_remote_reference
|
||||
from allmydata.interfaces import IUploadable, IUploader, IUploadResults, \
|
||||
IEncryptedUploadable, RIEncryptedUploadable, IUploadStatus, \
|
||||
NoServersError, InsufficientVersionError, UploadHappinessError
|
||||
NoServersError, InsufficientVersionError, UploadUnhappinessError
|
||||
from allmydata.immutable import layout
|
||||
from pycryptopp.cipher.aes import AES
|
||||
|
||||
@ -362,7 +362,7 @@ class Tahoe2PeerSelector:
|
||||
items.append((servernum, sharelist))
|
||||
return self._loop()
|
||||
else:
|
||||
raise UploadHappinessError("shares could only be placed "
|
||||
raise UploadUnhappinessError("shares could only be placed "
|
||||
"on %d servers (%d were requested)" %
|
||||
(len(effective_happiness),
|
||||
self.servers_of_happiness))
|
||||
@ -434,7 +434,7 @@ class Tahoe2PeerSelector:
|
||||
if self.last_failure_msg:
|
||||
msg += " (%s)" % (self.last_failure_msg,)
|
||||
log.msg(msg, level=log.UNUSUAL, parent=self._log_parent)
|
||||
raise UploadHappinessError(msg)
|
||||
raise UploadUnhappinessError(msg)
|
||||
else:
|
||||
# we placed enough to be happy, so we're done
|
||||
if self._status:
|
||||
|
@ -810,7 +810,7 @@ class NotEnoughSharesError(Exception):
|
||||
class NoSharesError(Exception):
|
||||
"""Download was unable to get any shares at all."""
|
||||
|
||||
class UploadHappinessError(Exception):
|
||||
class UploadUnhappinessError(Exception):
|
||||
"""Upload was unable to satisfy 'servers_of_happiness'"""
|
||||
|
||||
class UnableToFetchCriticalDownloadDataError(Exception):
|
||||
|
Loading…
x
Reference in New Issue
Block a user