0

I have code like this:

try {
    var client = new Steam.SteamClient();

    client.logOn(credentials);
} catch(err) {
    console.log(err);
    return;
}

But still cant catch the error:

MacBook-Pro:steam $ node test.js
\events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: Logon fail: 63
    at SteamClient.handlers.(anonymous function) (/Users/Sites/steam/node_modules/steam/lib/handlers/user.js:178:11)
    at SteamClient._netMsgReceived (/Users/Sites/steam/node_modules/steam/lib/steam_client.js:106:26)
    at SteamClient.handlers.(anonymous function) (/Users/Sites/steam/node_modules/steam/lib/steam_client.js:192:10)
    at SteamClient._netMsgReceived (/Users/Sites/steam/node_modules/steam/lib/steam_client.js:106:26)
    at Connection.emit (events.js:107:17)
    at Connection._readPacket (/Users/Sites/steam/node_modules/steam/lib/connection.js:50:8)
    at Connection.emit (events.js:104:17)
    at emitReadable_ (_stream_readable.js:424:10)
    at emitReadable (_stream_readable.js:418:7)
    at readableAddChunk (_stream_readable.js:174:11)

The problems is that I have a list of acc and need to auth only those, which are ok. But on this error program closes.

1 Answer 1

2

Error are passed through events for the Steam client, not through exceptions.

Try this:

var client = new Steam.SteamClient();

client.logOn(credentials);
client.on('error', function(err) {
  console.error('An error happened!');
  console.error(err);
});

More here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.