arrow icon indicating copy to clipboard operation
arrow copied to clipboard

There's literally no error handling in ArrowSetup.prototype.setup

Open samlecuyer opened this issue 11 years ago • 5 comments
trafficstars

https://github.com/yahoo/arrow/blob/master/lib/util/arrowsetup.js#L27

cb(null, ...) ignores any error that happens.

samlecuyer avatar Apr 11 '14 23:04 samlecuyer

@samlecuyer Thanks for pointing out. Does this look ok - https://github.com/pranavparikh/arrow/blob/errorHandling/lib/util/arrowsetup.js ? Do you have any other recommendations ?

pranavparikh avatar Apr 25 '14 07:04 pranavparikh

@pranavparikh cb is never invoked with any parameters. That's a problem

samlecuyer avatar Apr 25 '14 22:04 samlecuyer

@samlecuyer Something like ?

ArrowSetup.prototype.startArrowServer = function(cb) {

var self = this;
try {
    if (self.config.startArrowServer) {
        Servermanager.startArrowServer(function(arrowServerStarted) {
            if (arrowServerStarted === false) {
                self.logger.error('Failed to start Arrow Server. Exiting !!!');
                cb('Failed to start Arrow Server. Exiting !!!');
                return;
            }
            cb();
        });
    } 
}
catch(e) {
    cb(e);
}

};

pranavparikh avatar Apr 29 '14 06:04 pranavparikh

@pranavparikh much better

samlecuyer avatar Apr 29 '14 17:04 samlecuyer

@samlecuyer Thanks.I'll work on this and we can go through the changes once I'm done.

pranavparikh avatar Apr 29 '14 18:04 pranavparikh