Phasing out legacy dict for Result Objects

This commit is contained in:
SimplifiedPrivacy 2026-08-27 11:47:01 -04:00
parent ced69bfa4f
commit b29a44cf95

View file

@ -156,14 +156,14 @@ def use_ticket(
if ticket_exists == False: if ticket_exists == False:
error_msg = "The ticket file does not exist in the correct folder." error_msg = "The ticket file does not exist in the correct folder."
ticket_observer.notify("failed_input", subject=error_msg) ticket_observer.notify("failed_input", subject=error_msg)
return {"valid": False, "message": error_msg} return Result(valid=False, error_type=ResultError.INVALID_INPUT, message=error_msg)
# does the file keeping track of ALL tickets exist: # does the file keeping track of ALL tickets exist:
does_the_file_exist, path_of_file = does_ticket_tracker_exist() does_the_file_exist, path_of_file = does_ticket_tracker_exist()
if does_the_file_exist == False: if does_the_file_exist == False:
error_msg = f"The ticket tracker organizer file does not exist. Check the folder {path_of_file}" error_msg = f"The ticket tracker organizer file does not exist. Check the folder {path_of_file}"
ticket_observer.notify("failed_input", subject=error_msg) ticket_observer.notify("failed_input", subject=error_msg)
return {"valid": False, "message": error_msg} return Result(valid=False, error_type=ResultError.MISSING_FILE, message=error_msg)
# the actual work here, everything else is just handling: # the actual work here, everything else is just handling:
ticket_observer.notify("connecting", "Connecting..") ticket_observer.notify("connecting", "Connecting..")