Improved Enable and Disable Error Catching. Enable is stable and fully functional. Disable has issues with FirewallError still.

This commit is contained in:
SimplifiedPrivacy 2026-07-27 19:55:39 -04:00
parent 3a59cefb82
commit 23dbf97309
2 changed files with 10 additions and 6 deletions

View file

@ -11,7 +11,7 @@ from core.controllers.tickets.UseTicketController import (
from core.models.session.SessionProfile import SessionProfile from core.models.session.SessionProfile import SessionProfile
from core.models.system.SystemProfile import SystemProfile from core.models.system.SystemProfile import SystemProfile
from core.models.Result import Result, ResultError from core.models.Result import Result, ResultError
from core.errors.exceptions import SudoScript, MissingPreReqs from core.errors.exceptions import SudoScript, MissingPreReqs, FirewallError
from core.Errors import ( from core.Errors import (
CommandNotFoundError, CommandNotFoundError,
EndpointVerificationError, EndpointVerificationError,
@ -120,6 +120,8 @@ class Worker(QObject):
self.update_signal.emit(str(e), False, None, None, None) self.update_signal.emit(str(e), False, None, None, None)
except MissingPreReqs as e: except MissingPreReqs as e:
self.update_signal.emit(str(e), False, None, None, None) self.update_signal.emit(str(e), False, None, None, None)
except FirewallError as e:
self.update_signal.emit(str(e), False, None, None, None)
except Exception as e: except Exception as e:
print(e) print(e)
self.update_signal.emit( self.update_signal.emit(

View file

@ -16,7 +16,7 @@ from core.models.session.SessionProfile import SessionProfile
from core.models.system.SystemConnection import SystemConnection from core.models.system.SystemConnection import SystemConnection
from core.models.BaseProfile import ProfileType from core.models.BaseProfile import ProfileType
from core.models.system.SystemProfile import SystemProfile from core.models.system.SystemProfile import SystemProfile
from core.errors.exceptions import SudoScript, MissingPreReqs from core.errors.exceptions import SudoScript, MissingPreReqs, FirewallError
from core.models.Result import Result, ResultError from core.models.Result import Result, ResultError
from gui.v2.infrastructure.setup_observers import ( from gui.v2.infrastructure.setup_observers import (
@ -135,10 +135,12 @@ class WorkerThread(QThread):
ProfileController.disable( ProfileController.disable(
profile, ignore=True, profile_observer=profile_observer) profile, ignore=True, profile_observer=profile_observer)
self.text_output.emit("All profiles were successfully disabled") self.text_output.emit("All profiles were successfully disabled")
# except SudoScript as e: except SudoScript as e:
# self.text_output.emit(e) self.text_output.emit(e)
# except MissingPreReqs as e: except FirewallError as e:
# self.text_output.emit(e) self.text_output.emit(e)
except MissingPreReqs as e:
self.text_output.emit(e)
except Exception: except Exception:
self.text_output.emit("An error occurred when disabling profile") self.text_output.emit("An error occurred when disabling profile")
finally: finally: