Skip to content

[SDK 6] Unhandled rejection when the network connection is lost #343

@scottinet

Description

@scottinet

Expected Behavior

Errors should be discarded if no listener is registered on the networkError event.

Current Behavior

This:

(node:4358) UnhandledPromiseRejectionWarning: Error: [object Object]
    at WebSocketClient.client.onerror.error [as internalOnError] (/home/scottinet/git/sdk-javascript/src/protocols/websocket.js:75:58)
    at process.nextTick (/home/scottinet/git/sdk-javascript/node_modules/uws/uws.js:80:19)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
(node:4358) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 91)

Steps to Reproduce

  1. connect the SDK to a non-existent kuzzle host using Node.js' REPL

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions