Skip to content
Snippets Groups Projects

Refactor: add error handling for unknown channel type

Merged Martina Müller requested to merge error-handling-channeltype into main
2 files
+ 8
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -601,6 +601,8 @@ class ChannelFactory:
Returns:
(GenericChannel): A concrete implementation of the generic channel
Raises:
ValueError: If no matching channel type is found
"""
if channel_name in ChannelType.QUEUE.channels:
self.logger.debug(f"Create new QUEUE channel '{channel_name}'")
@@ -611,8 +613,11 @@ class ChannelFactory:
if channel_name in ChannelType.LIVE.channels:
self.logger.debug(f"Create new LINE channel '{channel_name}'")
return LineChannel(channel_index, channel_name, mixer)
# FIXME: Error handling when no ChannelType was found
self.logger.error("No ChannelType found! Now stuff is not working as intended")
error_message = (
f"No valid ChannelType found for channel '{channel_name}'. Not working as intended."
)
self.logger.error(error_message)
raise ValueError(error_message)
class PlayoutStatusResponse(StrEnum):
Loading