Jump to content
McKay Development

Recommended Posts

can you give example please?)

For example when sending an offer.

There are many options:

try {
offer.send()
} catch(err) {
//if fire exception you will come here
...handle this
1.log
2.retry logic
3.etc.
}
offer.send(err => err ? ...further logic : ...handle an error)
in nodejs....

process.on("uncaughtException", err => ...handle an error);.

It's not all the options, but I think that's enough. For other methods, respectively, too. The application should not crash. Good Luck.

Edited by vmysiur
Link to comment
Share on other sites

In any way that I described above.

 

For example:

 function foo(account) {
   try {
     ...Here you call the method that authorizes the account
   } catch (err) {
    ...Here you are processing an error, as an example you can repeat the authorization logic through time using the timeout.
    Repeatedly call this function after some time...    
    return setTimeout(() => foo(account), some time);
   }
 }
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...