File tree 1 file changed +9
-6
lines changed
modules/models/slack_models
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -283,12 +283,15 @@ def __init__(self, team_info: SlackTeamInfo) -> None:
283
283
def find_channel_by_name (self , channel_name : str ) -> SlackConversationInfo :
284
284
logger .debug (f"Finding channel by name: { channel_name } " )
285
285
logger .debug (f"Full channel list: { [conversation_info .name for conversation_info in self .full_conversation_list ]} " )
286
- return [
287
- conversation
288
- for conversation in self .full_conversation_list
289
- if conversation .name == channel_name
290
- ][0 ]
291
-
286
+ try :
287
+ return [
288
+ conversation
289
+ for conversation in self .full_conversation_list
290
+ if conversation .name == channel_name
291
+ ][0 ]
292
+ except IndexError :
293
+ logger .exception (f"Could not find channel by name: { channel_name } " )
294
+ raise Exception (f"Could not find channel by name: { channel_name } " )
292
295
@property
293
296
def slack_id (self ) -> str :
294
297
return self ._team_info .id
You can’t perform that action at this time.
0 commit comments