Catch exceptions from worker controller.
Surprise exceptions can get hidden by the Gearman stuff. Catch them here and report failure. Change-Id: I7fab24d809f8e91bc68c45296f369011e4d5c30d
This commit is contained in:
@@ -45,6 +45,8 @@ class LBaaSController(object):
|
||||
|
||||
action = self.msg[self.ACTION_FIELD].upper()
|
||||
self.logger.info("Requested action: %s" % action)
|
||||
|
||||
try:
|
||||
if action == 'CREATE':
|
||||
return self._action_create()
|
||||
elif action == 'UPDATE':
|
||||
@@ -60,6 +62,11 @@ class LBaaSController(object):
|
||||
(self.ACTION_FIELD, action))
|
||||
self.msg[self.RESPONSE_FIELD] = self.RESPONSE_FAILURE
|
||||
return self.msg
|
||||
except Exception as e:
|
||||
self.logger.error("Controller exception: %s, %s" %
|
||||
(e.__class__, e))
|
||||
self.msg[self.RESPONSE_FIELD] = self.RESPONSE_FAILURE
|
||||
return self.msg
|
||||
|
||||
def _action_create(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user