Skip to content

DeprecationWarning: Unhandled promise rejections are deprecated. #201

@romanzipp

Description

@romanzipp

Actual behaviour:

Unhandled promise rejections are deprecated.

Fix:

client.js Line 984

// Send command to server or channel..
client.prototype._sendCommand = function _sendCommand(delay, channel, command, fn) {
    // Race promise against delay..
    return new Promise((resolve, reject) => {
        _.promiseDelay(delay).then(() => { reject("No response from Twitch."); });
        // (...)
        // Disconnected from server..
        else { reject("Not connected to server."); }
    }).catch(() => {});
};

Error log:

(node:26041) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): No response from Twitch.
(node:26041) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Server configuration

  • Operating system: Debian 8.6
  • Node version (if applicable): 7.4
  • NPM version (if applicable): 4.0.5
  • tmi.js version: 1.1.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions