Commit b213b8b6 authored by Vincent Pelletier's avatar Vincent Pelletier

Move error detail from logs to exception payload.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2249 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 1da6ebc1
...@@ -443,17 +443,16 @@ class Application(object): ...@@ -443,17 +443,16 @@ class Application(object):
cell_list = self._getCellListForOID(oid, readable=True) cell_list = self._getCellListForOID(oid, readable=True)
if len(cell_list) == 0: if len(cell_list) == 0:
# No cells available, so why are we running ? # No cells available, so why are we running ?
logging.error('oid %s not found because no storage is ' \ raise NEOStorageError('No storage available for oid %s' % (
'available for it', dump(oid)) dump(oid), ))
raise NEOStorageNotFoundError()
shuffle(cell_list) shuffle(cell_list)
cell_list.sort(key=self.cp.getCellSortKey) cell_list.sort(key=self.cp.getCellSortKey)
self.local_var.asked_object = 0 self.local_var.asked_object = 0
packet = Packets.AskObject(oid, serial, tid) packet = Packets.AskObject(oid, serial, tid)
for cell in cell_list: for cell in cell_list:
logging.debug('trying to load %s from %s', logging.debug('trying to load %s at %s before %s from %s',
dump(oid), dump(cell.getUUID())) dump(oid), dump(serial), dump(tid), dump(cell.getUUID()))
conn = self.cp.getConnForCell(cell) conn = self.cp.getConnForCell(cell)
if conn is None: if conn is None:
continue continue
...@@ -489,14 +488,11 @@ class Application(object): ...@@ -489,14 +488,11 @@ class Application(object):
if self.local_var.asked_object == 0: if self.local_var.asked_object == 0:
# We didn't got any object from all storage node because of # We didn't got any object from all storage node because of
# connection error # connection error
logging.warning('oid %s not found because of connection failure', raise NEOStorageError('connection failure')
dump(oid))
raise NEOStorageNotFoundError()
if self.local_var.asked_object == -1: if self.local_var.asked_object == -1:
# We didn't got any object from all storage node # We didn't got any object from all storage node
logging.info('oid %s not found', dump(oid)) raise NEOStorageNotFoundError('oid %s not found' % (dump(oid), ))
raise NEOStorageNotFoundError()
# Uncompress data # Uncompress data
if compression: if compression:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment