Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom exceptions #179

Closed
82 tasks done
tcaiazzi opened this issue Sep 2, 2022 · 0 comments
Closed
82 tasks done

Add custom exceptions #179

tcaiazzi opened this issue Sep 2, 2022 · 0 comments
Assignees
Labels
enhancement minor issue next release The feature will be added in the next release

Comments

@tcaiazzi
Copy link
Member

tcaiazzi commented Sep 2, 2022

We need to add custom exceptions to improve error handling and troubleshooting.

We need to change all these basic exceptions:

  • src/Kathara/utils.py

    • raise Exception("Not implemented for %s." % architecture)
  • src/Kathara/auth/PrivilegeHandler.py

    • raise Exception("This class is a singleton!")
  • src/Kathara/cli/command/ListCommand.py

    • raise Exception("You must be root in order to show all Kathara devices of all users.")
  • src/Kathara/cli/command/LstartCommand.py

    • raise Exception("You must be root in order to start Kathara devices in privileged mode.")
    • raise Exception("No devices in the current network scenario. Exiting...")
  • src/Kathara/cli/command/VstartCommand.py

    • raise Exception("You must be root in order to start this Kathara device in privileged mode.")
    • raise Exception("Interface number in --eth %s:%s is not a number." % (iface_number, cd))
  • src/Kathara/cli/command/WipeCommand.py

    • raise Exception("You must be root in order to wipe all Kathara devices of all users.")
  • src/Kathara/cli/ui/utils.py

    • raise Exception("Unable to find Kathara.")
  • src/Kathara/event/EventDispatcher.py

    • raise Exception("This class is a singleton!")
  • src/Kathara/foundation/cli/CliArgs.py

    • raise Exception("This class is a singleton!")
  • src/Kathara/foundation/cli/ui/setting/OptionsHandler.py

    • raise Exception("add called without a MenuFactory set.")
  • src/Kathara/manager/Kathara.py

    • raise Exception("This class is a singleton!")
  • src/Kathara/manager/docker/DockerImage.py

    • raise Exception("Docker Image %s is not compatible with your host architecture: %s." % (image_name, e.arch))
    • raise Exception("Docker Image %s is not available neither on Docker Hub nor in local repository!" % image_name)
    • raise Exception("Docker Image %s is not compatible with your host architecture %s." % (image_name, e.arch))
  • src/Kathara/manager/docker/DockerLink.py

    • raise Exception("No collision domains found.")
    • raise Exception(f"Collision domains with name {link_name} not found.")
  • src/Kathara/manager/docker/DockerMachine.py

    • raise Exception("The specified device %s is not running." % machine_name)
    • raise Exception("The specified device %s is not running." % machine_name)
    • raise Exception("No devices found.")
    • raise Exception(f"Devices with name {machine_name} not found.")
  • src/Kathara/manager/docker/DockerManager.py

    • raise Exception("Machine %s is not associated to a network scenario." % machine.name)
    • raise Exception("Collision domain %s is not associated to a network scenario." % link.name)
    • raise Exception(f"The following devices are not in the network scenario: {machines_not_in_lab}.")
    • raise Exception("Machine %s is not associated to a network scenario." % machine.name)
    • raise Exception("Machine %s is already connected to collision domain %s." % (machine.name, link.name))
    • raise Exception("Machine %s is not associated to a network scenario." % machine.name)
    • raise Exception("Machine %s is not connected to collision domain %s." % (machine.name, link.name))
    • raise Exception("Machine %s is not associated to a network scenario." % machine.name)
    • raise Exception("Collision domain %s is not associated to a network scenario." % link.name)
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception(f"Device {machine_name} not found.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception(f"Collision Domain {link_name} not found.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
  • src/Kathara/manager/docker/DockerPlugin.py

    • raise Exception("Kathara Network Plugin not found on remote Docker connection.")
    • raise Exception("Kathara Network Plugin not enabled on remote Docker connection.")
  • src/Kathara/manager/kubernetes/KubernetesConfigMap.py

    • raise Exception(
  • src/Kathara/manager/kubernetes/KubernetesLink.py

    • raise Exception("No collision domains found.")
    • raise Exception(f"Collision domains with name {link_name} not found.")
  • src/Kathara/manager/kubernetes/KubernetesMachine.py

    • raise Exception("The specified device %s is not running." % machine_name)
    • raise Exception('Device %s is not ready.' % machine_name)
    • raise Exception("The specified device %s is not running." % machine_name)
    • raise Exception("No devices found.")
    • raise Exception(f"Devices with name {machine_name} not found.")
  • src/Kathara/manager/kubernetes/KubernetesManager.py

    • raise Exception("Machine %s is not associated to a network scenario." % machine.name)
    • raise Exception("Collision domain %s is not associated to a network scenario." % link.name)
    • raise Exception(f"The following devices are not in the network scenario: {machines_not_in_lab}.")
    • raise Exception("Previous lab execution is still terminating. Please wait.")
    • raise Exception("Machine %s is not associated to a network scenario." % machine.name)
    • raise Exception("Collision domain %s is not associated to a network scenario." % link.name)
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception(f"Device {machine_name} not found.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception(f"Collision Domain {link_name} not found.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
    • raise Exception("You must specify a running network scenario hash or name.")
  • src/Kathara/model/Lab.py

    • raise Exception("Collision domain %s (declared in lab.ext) not found in lab "
    • raise Exception("shared folder is a symlink, delete it.")
  • src/Kathara/model/Machine.py

    • raise Exception("Invalid device name %s." % name)
    • raise Exception("Interface %d already set on device %s." % (number, self.name))
    • raise Exception("Device %s is not connected to collision domain %s." % (self.name, link.name))
  • src/Kathara/os/Networking.py

    • raise Exception("Interface %s not found." % full_interface_name)
    • raise Exception("Cannot find iptables in the host.")
  • src/Kathara/parser/netkit/DepParser.py

    • raise Exception("[ERROR] In lab.dep - line %d: Syntax error." % line_number)
    • raise Exception("ERROR: Loop in lab.dep.\n")
  • src/Kathara/parser/netkit/ExtParser.py

    • raise Exception("[ERROR] In file lab.ext, line %d: "
    • raise Exception("[ERROR] In file lab.ext, line %d malformed." % line_number)
  • src/Kathara/parser/netkit/LabParser.py

    • raise Exception("[ERROR] In line %d: "
    • raise Exception("[ERROR] In line %d: "
    • raise Exception("[ERROR] In line %d: Invalid characters %s." % (line_number, line))
  • src/Kathara/setting/Setting.py

    • raise Exception("This class is a singleton!")
@tcaiazzi tcaiazzi self-assigned this Sep 2, 2022
tcaiazzi added a commit that referenced this issue Sep 2, 2022
tcaiazzi added a commit that referenced this issue Sep 2, 2022
tcaiazzi added a commit that referenced this issue Sep 2, 2022
@tcaiazzi tcaiazzi added enhancement minor issue next release The feature will be added in the next release labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement minor issue next release The feature will be added in the next release
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants