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

feature: Added support to list[list[int]] input #428

Merged
merged 13 commits into from
Nov 22, 2023
47 changes: 46 additions & 1 deletion kytos/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,52 @@ class KytosLinkCreationError(Exception):


class KytosTagtypeNotSupported(Exception):
"""Exception thronw when a not supported tag type is not supported"""
"""Exception thrown when a not supported tag type is not supported"""
viniarck marked this conversation as resolved.
Show resolved Hide resolved


class KytosTagsNotInTagRanges(Exception):
"""Exception thrown when a tag is outside of tag ranges"""
def __init__(self, conflict: list[list[int]], intf_id: str) -> None:
super().__init__()
self.conflict = conflict
self.intf_id = intf_id

def __repr__(self):
return f"The tags {self.conflict} are outside tag_ranges"\
f" in {self.intf_id}"

def __str__(self) -> str:
return f"The tags {self.conflict} are outside tag_ranges"\
f" in {self.intf_id}"


class KytosTagsAreNotAvailable(Exception):
"""Exception thrown when a tag is not available."""
def __init__(self, conflict: list[list[int]], intf_id: str) -> None:
super().__init__()
self.conflict = conflict
self.intf_id = intf_id

def __repr__(self):
return f"The tags {self.conflict} are not available."\
viniarck marked this conversation as resolved.
Show resolved Hide resolved
f" in {self.intf_id}"

def __str__(self) -> str:
return f"The tags {self.conflict} are not available."\
f" in {self.intf_id}"


class KytosInvalidRanges(Exception):
"""Exception thrown when a tag is not available."""
viniarck marked this conversation as resolved.
Show resolved Hide resolved
def __init__(self, message: str) -> None:
super().__init__()
self.message = message

def __repr__(self):
return f"KytosInvalidRanges {self.message}"

def __str__(self) -> str:
return f"KytosInvalidRanges {self.message}"


# Exceptions related to NApps
Expand Down
Loading
Loading