Add error handling when the ChannelType is not known
While breaking engine-core I found out that engine returns None
when the ChannelType
is not known. I would suggest to refactor this together with #145 by raising an exception.
if channel_name in ChannelType.QUEUE.channels:
self.logger.debug(f"Create new QUEUE channel '{channel_name}'")
return QueueChannel(channel_index, channel_name, mixer)
if channel_name in ChannelType.HTTP.channels:
self.logger.debug(f"Create new STREAM channel '{channel_name}'")
return StreamChannel(channel_index, channel_name, mixer)
if channel_name in ChannelType.LIVE.channels:
self.logger.debug(f"Create new LINE channel '{channel_name}'")
return LineChannel(channel_index, channel_name, mixer)