File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed
Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @blink-sdk/slack" ,
3- "version" : " 1.2.1 " ,
3+ "version" : " 1.2.2 " ,
44 "author" : {
55 "name" : " Coder" ,
66 "email" : " support@blink.so" ,
Original file line number Diff line number Diff line change @@ -582,7 +582,12 @@ export const extractMessagesMetadata = async <
582582 for ( const channelId of channelIds ) {
583583 channelPromises [ channelId ] = client . conversations
584584 . info ( { channel : channelId } )
585- . then ( ( res ) => res . channel ) ;
585+ . then ( ( res ) => {
586+ if ( ! res . ok ) {
587+ throw new Error ( `Failed to get channel info: ${ res . error } ` ) ;
588+ }
589+ return res . channel ;
590+ } ) ;
586591 }
587592
588593 // Fetch team info
@@ -591,9 +596,12 @@ export const extractMessagesMetadata = async <
591596 Promise < TeamInfoResponse [ "team" ] | undefined >
592597 > = { } ;
593598 for ( const teamId of teamIds ) {
594- teamPromises [ teamId ] = client . team
595- . info ( { team : teamId } )
596- . then ( ( res ) => res . team ) ;
599+ teamPromises [ teamId ] = client . team . info ( { team : teamId } ) . then ( ( res ) => {
600+ if ( ! res . ok ) {
601+ throw new Error ( `Failed to get team info: ${ res . error } ` ) ;
602+ }
603+ return res . team ;
604+ } ) ;
597605 }
598606
599607 // Fetch user info
@@ -602,9 +610,12 @@ export const extractMessagesMetadata = async <
602610 Promise < UsersInfoResponse [ "user" ] | undefined >
603611 > = { } ;
604612 for ( const userId of userIds ) {
605- userPromises [ userId ] = client . users
606- . info ( { user : userId } )
607- . then ( ( res ) => res . user ) ;
613+ userPromises [ userId ] = client . users . info ( { user : userId } ) . then ( ( res ) => {
614+ if ( ! res . ok ) {
615+ throw new Error ( `Failed to get user info: ${ res . error } ` ) ;
616+ }
617+ return res . user ;
618+ } ) ;
608619 }
609620
610621 // Fetch files
You can’t perform that action at this time.
0 commit comments