mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-08 02:21:19 +00:00
apol: Fix tab field error exception to not override built-in TabError.
This commit is contained in:
parent
3211062ac2
commit
ad28e76a15
@ -18,7 +18,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
class TabError(RuntimeError):
|
class TabFieldError(RuntimeError):
|
||||||
|
|
||||||
"""Exception when trying to save a tab that has errors."""
|
"""Exception when trying to save a tab that has errors."""
|
||||||
pass
|
pass
|
||||||
|
@ -31,7 +31,7 @@ from setools import __version__, PermissionMap, SELinuxPolicy
|
|||||||
from ..widget import SEToolsWidget
|
from ..widget import SEToolsWidget
|
||||||
from ..logtosignal import LogHandlerToSignal
|
from ..logtosignal import LogHandlerToSignal
|
||||||
from .chooseanalysis import ChooseAnalysis, tab_map
|
from .chooseanalysis import ChooseAnalysis, tab_map
|
||||||
from .exception import TabError
|
from .exception import TabFieldError
|
||||||
from .permmapedit import PermissionMapEditor
|
from .permmapedit import PermissionMapEditor
|
||||||
from .summary import SummaryTab
|
from .summary import SummaryTab
|
||||||
|
|
||||||
@ -415,7 +415,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow):
|
|||||||
try:
|
try:
|
||||||
settings = self._get_settings()
|
settings = self._get_settings()
|
||||||
|
|
||||||
except TabError as ex:
|
except TabFieldError as ex:
|
||||||
self.log.critical("Errors in the query prevent saving the settings. {0}".format(ex))
|
self.log.critical("Errors in the query prevent saving the settings. {0}".format(ex))
|
||||||
self.error_msg.critical(self, "Unable to save settings",
|
self.error_msg.critical(self, "Unable to save settings",
|
||||||
"Please resolve errors in the tab before saving the settings."
|
"Please resolve errors in the tab before saving the settings."
|
||||||
@ -578,7 +578,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
settings = tab.save()
|
settings = tab.save()
|
||||||
except TabError as ex:
|
except TabFieldError as ex:
|
||||||
tab_name = self.AnalysisTabs.tabText(index)
|
tab_name = self.AnalysisTabs.tabText(index)
|
||||||
save_errors.append(tab_name)
|
save_errors.append(tab_name)
|
||||||
self.log.error("Error: tab \"{0}\": {1}".format(tab_name, str(ex)))
|
self.log.error("Error: tab \"{0}\": {1}".format(tab_name, str(ex)))
|
||||||
|
Loading…
Reference in New Issue
Block a user