File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
hrm-domain/scheduled-tasks/conversation-cleanup Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,20 @@ const removeConversationsBySids = async (
9999 }
100100 }
101101 console . debug ( `Removing conversation ${ sid } from account ${ accountSid } ` ) ;
102- const result = await twilioClient . conversations . v1 . conversations . get ( sid ) . remove ( ) ;
103- if ( result ) {
104- console . debug ( `Removed conversation ${ sid } from account ${ accountSid } ` ) ;
105- } else {
106- console . warn ( `Failed to remove conversation ${ sid } from account ${ accountSid } ` ) ;
102+ try {
103+ const result = await twilioClient . conversations . v1 . conversations . get ( sid ) . remove ( ) ;
104+ if ( result ) {
105+ console . debug ( `Removed conversation ${ sid } from account ${ accountSid } ` ) ;
106+ } else {
107+ console . warn (
108+ `Failed to remove conversation ${ sid } from account ${ accountSid } . Method returned false` ,
109+ ) ;
110+ }
111+ } catch ( err ) {
112+ console . warn (
113+ `Failed to remove conversation ${ sid } from account ${ accountSid } . Error thrown:` ,
114+ err ,
115+ ) ;
107116 }
108117 } ) ;
109118 return Promise . all ( removePromises ) ;
You can’t perform that action at this time.
0 commit comments