Created **fn_gen** repository and added python library

This commit is contained in:
2024-01-16 17:03:03 +01:00
committed by Ali Elnwegy
parent 00b4ce0149
commit 962f4c718b
24 changed files with 301 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
from .undefined_communication_method_error import UndefinedCommunicationMethodError
from .value_out_of_bounds_error import ValueOutOfBoundsError
from .undefined_value_error import UndefinedValueError

View File

@@ -0,0 +1,5 @@
class UndefinedCommunicationMethodError(Exception):
def __init__(self, port: str):
method = port.split( "::" )[0]
super().__init__( f"ERROR: Undefined Communication Exception, Method \"{method}\" is not recognized in Port \"{port}\"." )

View File

@@ -0,0 +1,4 @@
class UndefinedValueError(Exception):
def __init__(self, value: str, expected: str):
super().__init__( f"ERROR: Undefined Value, expected: {expected}, value: {value}." )

View File

@@ -0,0 +1,4 @@
class ValueOutOfBoundsError(Exception):
def __init__(self, bounds: tuple[float, float] | tuple[int, int], value: float | int):
super().__init__( f"ERROR: Value out of expected bounds, Min: {bounds[0]}, Max: {bounds[1]}, Value: {value}." )