from allmydata.util.assertutil import _assert, precondition
from allmydata.codec import CRSEncoder
from allmydata.interfaces import IEncoder, IStorageBucketWriter, \
- IEncryptedUploadable, IUploadStatus, UploadHappinessError
+ IEncryptedUploadable, IUploadStatus, UploadUnhappinessError
"""
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),
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)
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
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))
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:
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):