Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uncaught exceptions when reading and writing messages via TCP #475

Conversation

Sadzurami
Copy link
Contributor

@Sadzurami Sadzurami commented Feb 22, 2024

Exceptions here happens not often, but they are.

Examples:

Here we don't know where exactly error goes on.

Uncaught exception: Cannot read properties of undefined (reading 'write')

Error: Uncaught exception
    at process.<anonymous> (C:\project\dist\main.js)
    at process.emit (node:events:537:28)
    at process.processEmit [as emit] (C:\project\node_modules\signal-exit\index.js:199:34)
    at process._fatalException (node:internal/process/execution:167:25)
caused by: TypeError: Cannot read properties of undefined (reading 'write')
    at TCPConnection.send (C:\project\node_modules\steam-user\components\connection_protocols\tcp.js:165:15)
    at SteamUser._send (C:\project\node_modules\steam-user\components\03-messages.js:492:20)
    at Timeout._onTimeout (C:\project\node_modules\steam-user\components\09-logon.js:776:11)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

Here we can see, that error happened after logOff.

Uncaught exception: Cannot read properties of undefined (reading 'write')

Error: Uncaught exception
    at process.<anonymous> (C:\project\dist\main.js)
    at process.emit (node:events:537:28)
    at process.processEmit [as emit] (C:\project\node_modules\signal-exit\index.js:199:34)
    at process._fatalException (node:internal/process/execution:167:25)
caused by: TypeError: Cannot read properties of undefined (reading 'write')
    at TCPConnection.send (C:\project\node_modules\steam-user\components\connection_protocols\tcp.js:165:15)
    at SteamUser._send (C:\project\node_modules\steam-user\components\03-messages.js:492:20)
    at SteamUser._disconnect (C:\project\node_modules\steam-user\components\09-logon.js:501:9)
    at SteamUser.logOff (C:\project\node_modules\steam-user\components\09-logon.js:485:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

ref: #392

@DoctorMcKay DoctorMcKay merged commit f59af6d into DoctorMcKay:master Sep 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants