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

Unhandled rejection (<{"state":"failed","reason":{"code":13,...>, no stack trace) #17

Open
raluiz opened this issue Dec 2, 2019 · 1 comment

Comments

@raluiz
Copy link

raluiz commented Dec 2, 2019

Quando tento rodar o código do index.js, recebo o seguinte erro Unhandled rejection (<{"state":"failed","reason":{"code":13,...>, no stack trace).
Utilizei o comando node index.js para executar o arquivo pelo terminal.

index.js

let BlipSdk = require('blip-sdk');
let WebSocketTransport = require('lime-transport-websocket');

// Put your identifier and access key here
let IDENTIFIER = 'example';
let ACCESS_KEY = 'example';

// Create a client instance passing the identifier and accessKey of your chatbot
let client = new BlipSdk.ClientBuilder()
    .withIdentifier(IDENTIFIER)
    .withAccessKey(ACCESS_KEY)
    //Erro no arrow function
    .withTransportFactory(() => new WebSocketTransport())
    .withTransportFactory(function() { return (new WebSocketTransport())})
    .build();

// Connect with server asynchronously
// Connection will occurr via websocket on 8081 port.
client.connect() // This method return a 'promise'.
    .then(function(session) {
        // Connection success. Now is possible send and receive envelopes from server. */
        console.log('Application started. Press Ctrl + c to stop.')
    })
    .catch(function(err) { /* Connection failed. */ });
@ceifa
Copy link
Contributor

ceifa commented Mar 11, 2020

Can you post the entire error object? It contains the error reason and stacktrace, which help us to identify the problem.

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

No branches or pull requests

2 participants