Jump to content
McKay Development

Timeout and code breaks

Recommended Posts

hi i am facing code crashes on a few occasion for example when the steamcommunity has a 503 error means their server is down or when the steam user request time outs the problem is that it is inherent to the libraries once these occur the whole code crashes isnt it should have a backoff or retry mechanism? instead of the throwing of error whats teh fix to this?

    let err = new Error('Request timed out');

Error: Request timed out
    at timeoutPromise (C:\Autoconfirmbot\node_modules\steam-user\node_modules\@doctormckay\stdlib\lib\promises\timeoutPromise.js:12:15)
    at HttpClient.request (C:\Autoconfirmbot\node_modules\steam-user\node_modules\@doctormckay\stdlib\lib\http\client\HttpClient.js:63:46)
    at SteamUser._apiRequest (C:\Autoconfirmbot\node_modules\steam-user\components\06-webapi.js:60:26)
    at SteamUser._doConnection (C:\Autoconfirmbot\node_modules\steam-user\components\09-logon.js:296:32)
    at Timeout._onTimeout (C:\Autoconfirmbot\node_modules\steam-user\components\09-logon.js:311:27)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
Emitted 'error' event on SteamUser instance at:
    at SteamUser._doConnection (C:\Autoconfirmbot\node_modules\steam-user\components\09-logon.js:309:10)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)

Link to comment
Share on other sites

Your app has crashed because you aren't listening for the error event. Every Node.js EventEmitter crashes the app if an unhandled error event is emitted.

The error in question is raised when steam-user fails to retrieve the Steam server list from the WebAPI after 10 retries.

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.

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.

  • Create New...