You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following snippet in my code and the catch block is never reached.
try{constmessageId=awaitthis.pivbotService.directLine.postActivity({from: this.from,type: 'message',text: message}).toPromise();console.log(messageId);// Logs text "retry"}catch(err){// Never reachedconsole.error(err);}
Shouldn't catchExpiredToken method throw error in any case?
The text was updated successfully, but these errors were encountered:
Most posting errors are nonrecoverable (reposting is not expected to yield different results), and in those cases we throw an error. But if a token is expired a new one can be obtained, and the message can be reposted. So instead of throwing an error here, we mark the message as "retry" so that it can be reposted later. This admittedly an inelegant solution. It's convenient for WebChat, but maybe not so much for other applications.
The way to handle these is to subscribe to connectionStatus$ and handle ConnectionStatus.ExpiredToken.
From the following snippet, the ExpiredToken error is resolved as success.
I have the following snippet in my code and the catch block is never reached.
Shouldn't
catchExpiredToken
method throw error in any case?The text was updated successfully, but these errors were encountered: