Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

add error event for server??? #458

Closed
stableShip opened this issue Apr 24, 2016 · 4 comments
Closed

add error event for server??? #458

stableShip opened this issue Apr 24, 2016 · 4 comments

Comments

@stableShip
Copy link
Contributor

stableShip commented Apr 24, 2016

using mosca-v1.2.0, when I start a mosca server with mongodb as persistence,rabbitmq as backend, my mongodb did not start , I started my mosca server , it did't show any error and the ready message. I try to listen "error" event, nothing log.How can I get the error when I start the server??

server.on('error', function(err){
    console.log(err);
});

server.on('ready', function(){
    console.log('Mosca server is up and running');
});

my settting:

var pubsubsettings = {
    type: 'amqp',
    json: false,
    amqp: require('amqp'),
    exchange: 'ascolatore5672'
};

var moscaSettings = {
    port: 1883,
    backend: pubsubsettings,
    persistence: {
        factory: mosca.persistence.Mongo,
        url: "mongodb://localhost:27017/mosca"
    }
};
@mcollina
Copy link
Collaborator

I'm sorry but I don't understand what your issue is.

@stableShip
Copy link
Contributor Author

image
image
when my persistence config seted, but it can not connect to the mongodb.I hope the server will show me the connnect error message ,but there is nothing show

@mcollina
Copy link
Collaborator

You are right, currently Mosca is swallowing the error at startup, a callback when this async.series completes is missing.

Would you like to send a PR?

@stableShip
Copy link
Contributor Author

stableShip commented Apr 25, 2016

I will try , this is my first time to make a PR to a project like this, please don't bet on me, but I will try my best.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants