Supress error logs when exception is thrown
There are many cases when exceptions from the backend are expected and these exceptions must not be logged as errors. For example it is a common pattern to catch DuplicateName/AlreadyExists exceptions and ignore them in the cases when multiple threads are trying to perform the same operation. Currently there is no way for clients to prevent logging these exceptions as errors and the proper way to fix this is to just raise the exception in oslo and let the client decide if it must be logged as an error or not. Closes-Bug: #1377927 Change-Id: I5309cad5b0eeb380387eb3051d80c59b783561e8
This commit is contained in:
parent
ec5b717127
commit
42eab0c82f
@ -112,12 +112,6 @@ class RetryDecorator(object):
|
||||
self._retry_count += 1
|
||||
self._sleep_time += self._inc_sleep_time
|
||||
return self._sleep_time
|
||||
except Exception:
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.exception(_LE("Exception which is not in the "
|
||||
"suggested list of exceptions occurred "
|
||||
"while invoking %s."),
|
||||
func_name)
|
||||
raise loopingcall.LoopingCallDone(result)
|
||||
|
||||
def func(*args, **kwargs):
|
||||
|
@ -133,7 +133,6 @@ class DynamicLoopingCall(LoopingCallBase):
|
||||
self.stop()
|
||||
done.send(e.retvalue)
|
||||
except Exception:
|
||||
LOG.exception(_LE('in dynamic looping call'))
|
||||
done.send_exception(*sys.exc_info())
|
||||
return
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user