virtual_knitting_machine.knitting_machine_exceptions.Yarn_Carrier_Error_State module
Collection of exceptions for error states that involve yarn carriers and yarn management operations. This module provides comprehensive exception classes for various yarn carrier issues including hook conflicts, inactive carrier usage, yarn cutting errors, and carrier system modifications that would cause critical operational failures.
- exception Yarn_Carrier_Exception(carrier_id, message)[source]
Bases:
Knitting_Machine_Exception
Base class for exceptions related to yarn carrier operations and states. This class provides a foundation for all yarn carrier-specific exceptions and includes the carrier ID reference for detailed error reporting and debugging of carrier-related operational failures.
- __init__(carrier_id, message)[source]
Initialize a yarn carrier-specific exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier ID or carrier object involved in the exception condition.
message (str) – The descriptive error message about the carrier state or operation failure.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception Hooked_Carrier_Exception(carrier_id)[source]
Bases:
Yarn_Carrier_Exception
Exception for attempting hook operations on carriers that are already on the yarn inserting hook. This exception occurs when trying to perform an operation that requires the carrier to not be on the insertion hook, such as an outhook operation, when the carrier is currently connected to the hook.
- Parameters:
carrier_id (
Any
)
- __init__(carrier_id)[source]
Initialize a hooked carrier operation exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier that is already on the yarn inserting hook.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int
- exception Blocked_by_Yarn_Inserting_Hook_Exception(carrier_id, slot)[source]
Bases:
Yarn_Carrier_Exception
- __init__(carrier_id, slot)[source]
Initialize a yarn carrier-specific exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier ID or carrier object involved in the exception condition.
message (str) – The descriptive error message about the carrier state or operation failure.
slot (
int
)
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int
- exception Inserting_Hook_In_Use_Exception(carrier_id)[source]
Bases:
Yarn_Carrier_Exception
Exception for attempting to use the yarn inserting hook when it is already occupied by another carrier. This exception occurs when trying to perform hook operations while the insertion hook is already in use by a different carrier, preventing conflicts in hook operations.
- Parameters:
carrier_id (
Any
)
- __init__(carrier_id)[source]
Initialize an inserting hook in use exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier that attempted to use the already occupied insertion hook.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int
- exception Use_Inactive_Carrier_Exception(carrier_id)[source]
Bases:
Yarn_Carrier_Exception
Exception for attempting to use carriers that are not in active state. This exception occurs when trying to perform knitting operations with a carrier that is not active (still on grippers or otherwise unavailable), which would result in no yarn being fed to the needles.
- Parameters:
carrier_id (
Any
)
- __init__(carrier_id)[source]
Initialize an inactive carrier usage exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The inactive carrier that was attempted to be used.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int
- exception Use_Cut_Yarn_Exception(carrier_id)[source]
Bases:
Use_Inactive_Carrier_Exception
Exception for attempting to use yarn that has been cut from its carrier. This exception occurs when trying to perform knitting operations with yarn that has been severed from its carrier, making it impossible to continue yarn operations as the yarn is no longer connected to the carrier system.
- Parameters:
carrier_id (
Any
)
- __init__(carrier_id)[source]
Initialize a cut yarn usage exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The carrier ID from which the cut yarn originated.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int
- exception Change_Active_Yarn_Exception(carrier_id)[source]
Bases:
Yarn_Carrier_Exception
Exception for attempting to change yarn properties on carriers that are currently active. This exception occurs when trying to modify yarn properties or reassign yarn to a carrier that is actively being used for knitting operations, which could cause yarn consistency issues.
- Parameters:
carrier_id (
Any
)
- __init__(carrier_id)[source]
Initialize a change active yarn exception.
- Parameters:
carrier_id (int | Yarn_Carrier) – The active carrier for which yarn change was attempted.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int
- exception Change_Active_Carrier_System_Exception[source]
Bases:
Yarn_Carrier_Exception
Exception for attempting to change the carrier system while carriers are active. This exception occurs when trying to modify the number of carriers or replace the carrier system while there are still active carriers in use, which would cause loss of active yarn states and system inconsistencies.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
carrier_id:
Yarn_Carrier
|int