Error handling: Use exceptions.handle instead of check_message

We already have a centralized place for handling exceptions in horizon.
We should use horizon/exceptions.py(249)handle() instead of old
horizon/exceptions.py(96)check_message().

Change-Id: I4add35f6ca407d8c3fa8ab5bd1b96221b1f5b043
Closes-Bug: #1339885
This commit is contained in:
Robin Cernin 2019-04-23 22:12:11 +10:00 committed by Akihiro Motoki
parent d4d99891b8
commit e81a424f87
4 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ class DeleteShareGroupSnapshot(tables.DeleteAction):
except Exception:
msg = _('Unable to delete share group snapshot "%s". '
'One or more share groups depend on it.')
exceptions.check_message(["snapshots", "dependent"], msg % name)
exceptions.handle(self.request, msg % name)
raise
def allowed(self, request, snapshot=None):

View File

@ -65,7 +65,7 @@ class DeleteShareSnapshot(tables.DeleteAction):
except Exception:
msg = _('Unable to delete snapshot "%s". One or more shares '
'depend on it.')
exceptions.check_message(["snapshots", "dependent"], msg % name)
exceptions.handle(self.request, msg % name)
raise
def allowed(self, request, snapshot=None):

View File

@ -96,7 +96,7 @@ class DeleteShareGroupSnapshot(tables.DeleteAction):
except Exception:
msg = _('Unable to delete share group snapshot "%s". '
'One or more share groups depend on it.')
exceptions.check_message(["snapshots", "dependent"], msg % name)
exceptions.handle(self.request, msg % name)
raise
def allowed(self, request, snapshot=None):

View File

@ -118,7 +118,7 @@ class DeleteShareSnapshot(tables.DeleteAction):
except Exception:
msg = _('Unable to delete snapshot "%s". One or more shares '
'depend on it.')
exceptions.check_message(["snapshots", "dependent"], msg % name)
exceptions.handle(self.request, msg % name)
raise
def allowed(self, request, snapshot=None):