forked from Support/sp-hydra-veil-gui
Error handling for enabling profiles with issues using the sudo scripts.
This commit is contained in:
parent
1633562325
commit
b444ff9218
2 changed files with 16 additions and 0 deletions
|
|
@ -10,6 +10,8 @@ from core.controllers.tickets.UseTicketController import (
|
|||
)
|
||||
from core.models.session.SessionProfile import SessionProfile
|
||||
from core.models.system.SystemProfile import SystemProfile
|
||||
from core.models.Result import Result, ResultError
|
||||
from core.errors.exceptions import SudoScript, MissingPreReqs
|
||||
from core.Errors import (
|
||||
CommandNotFoundError,
|
||||
EndpointVerificationError,
|
||||
|
|
@ -114,6 +116,10 @@ class Worker(QObject):
|
|||
"PROFILE_STATE_CONFLICT_ERROR", False, self.profile_data['id'], None, None)
|
||||
except CommandNotFoundError as e:
|
||||
self.update_signal.emit(str(e.subject), False, -1, None, None)
|
||||
except SudoScript as e:
|
||||
self.update_signal.emit(str(e), False, None, None, None)
|
||||
except MissingPreReqs as e:
|
||||
self.update_signal.emit(str(e), False, None, None, None)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
self.update_signal.emit(
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ from core.models.session.SessionProfile import SessionProfile
|
|||
from core.models.system.SystemConnection import SystemConnection
|
||||
from core.models.BaseProfile import ProfileType
|
||||
from core.models.system.SystemProfile import SystemProfile
|
||||
from core.errors.exceptions import SudoScript, MissingPreReqs
|
||||
from core.models.Result import Result, ResultError
|
||||
|
||||
from gui.v2.infrastructure.setup_observers import (
|
||||
client_observer,
|
||||
|
|
@ -133,6 +135,10 @@ class WorkerThread(QThread):
|
|||
ProfileController.disable(
|
||||
profile, ignore=True, profile_observer=profile_observer)
|
||||
self.text_output.emit("All profiles were successfully disabled")
|
||||
# except SudoScript as e:
|
||||
# self.text_output.emit(e)
|
||||
# except MissingPreReqs as e:
|
||||
# self.text_output.emit(e)
|
||||
except Exception:
|
||||
self.text_output.emit("An error occurred when disabling profile")
|
||||
finally:
|
||||
|
|
@ -229,6 +235,10 @@ class WorkerThread(QThread):
|
|||
else:
|
||||
self.text_output.emit(
|
||||
f"No profile found with ID: {self.profile_data['id']}")
|
||||
# except SudoScript as e:
|
||||
# self.text_output.emit(str(e))
|
||||
# except MissingPreReqs as e:
|
||||
# self.text_output.emit(str(e))
|
||||
except Exception as e:
|
||||
self.text_output.emit("An error occurred when disabling profile")
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue