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:
parent
d4d99891b8
commit
e81a424f87
@ -56,7 +56,7 @@ class DeleteShareGroupSnapshot(tables.DeleteAction):
|
|||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to delete share group snapshot "%s". '
|
msg = _('Unable to delete share group snapshot "%s". '
|
||||||
'One or more share groups depend on it.')
|
'One or more share groups depend on it.')
|
||||||
exceptions.check_message(["snapshots", "dependent"], msg % name)
|
exceptions.handle(self.request, msg % name)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def allowed(self, request, snapshot=None):
|
def allowed(self, request, snapshot=None):
|
||||||
|
@ -65,7 +65,7 @@ class DeleteShareSnapshot(tables.DeleteAction):
|
|||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to delete snapshot "%s". One or more shares '
|
msg = _('Unable to delete snapshot "%s". One or more shares '
|
||||||
'depend on it.')
|
'depend on it.')
|
||||||
exceptions.check_message(["snapshots", "dependent"], msg % name)
|
exceptions.handle(self.request, msg % name)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def allowed(self, request, snapshot=None):
|
def allowed(self, request, snapshot=None):
|
||||||
|
@ -96,7 +96,7 @@ class DeleteShareGroupSnapshot(tables.DeleteAction):
|
|||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to delete share group snapshot "%s". '
|
msg = _('Unable to delete share group snapshot "%s". '
|
||||||
'One or more share groups depend on it.')
|
'One or more share groups depend on it.')
|
||||||
exceptions.check_message(["snapshots", "dependent"], msg % name)
|
exceptions.handle(self.request, msg % name)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def allowed(self, request, snapshot=None):
|
def allowed(self, request, snapshot=None):
|
||||||
|
@ -118,7 +118,7 @@ class DeleteShareSnapshot(tables.DeleteAction):
|
|||||||
except Exception:
|
except Exception:
|
||||||
msg = _('Unable to delete snapshot "%s". One or more shares '
|
msg = _('Unable to delete snapshot "%s". One or more shares '
|
||||||
'depend on it.')
|
'depend on it.')
|
||||||
exceptions.check_message(["snapshots", "dependent"], msg % name)
|
exceptions.handle(self.request, msg % name)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def allowed(self, request, snapshot=None):
|
def allowed(self, request, snapshot=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user