tmi.js icon indicating copy to clipboard operation
tmi.js copied to clipboard

after encountering error, try.catch always fires.

Open killedWithFire9001 opened this issue 8 years ago • 4 comments

this is an odd one for me so i will break it down the best i can

i use this code:

Twitchclient.join(channel).then(m => {
    console.log("Joined: " + m)
}).catch(err => {
    console.log("Unable to join channel: " + channel + " Error: " + err);
});

to join channels in IRC, the issue has arose since the new API update. if a channel does not exist anymore this code will throw Unable to join channel: #<ChannelName> Error: No response from Twitch.

which is expected, however ANY channel joined after will also throw this error despite there being no error, the join is also successful despite the error.

Actual behaviour: throw error on every channel joined after joining an moved channel

Expected behaviour: error to only throw on bad channels and not good ones joined after

Server configuration

  • Operating system: ArchLinux
  • Node version: v7.6.0
  • NPM version: 4.3.0
  • tmi.js version: 1.1.2

Server configuration

  • Operating system: CentOS 7.4
  • Node version: v7.6.0
  • NPM version: 4.1.2
  • tmi.js version: 1.1.2

killedWithFire9001 avatar Feb 27 '17 21:02 killedWithFire9001

Probably Twitch ban your IP for limit exceeding. Reload you IP address or try something different way. Recommending test Websocket connection into twitch IRC Websocket server from yourself and bot: https://twitchstuff.3v.fi/chat/

stachu540 avatar Mar 10 '17 07:03 stachu540

this is nothing todo with IP bans or anything, this is a reproducible error, as i stated the join is also successful despite the error.

killedWithFire9001 avatar Mar 10 '17 18:03 killedWithFire9001

This thing maybe still buggy like this: #163

stachu540 avatar Mar 12 '17 04:03 stachu540

yes it does look like it, the event is successful and the error can be dismissed as a false positive however when all promises reject afterwards if you was to encounter a legitimate issue its basically unrecognisable.

killedWithFire9001 avatar Mar 20 '17 08:03 killedWithFire9001