Skip to content

Throw 'Exception' in try catch to process.on('uncaughtException',callback) #23

@letiennam29

Description

@letiennam29

Hi everyone,
I think script code in file "pomelo-rpc/lib/rpc-server/acceptors/ws-acceptor.js" need throw to process on uncaughtException. It flexibility for deverlop.

Because sometime exception i need wirter log after check.

socket.on('message', function(pkg) {
try {
if(pkg instanceof Array) {
processMsgs(socket, self, pkg);
} else {
processMsg(socket, self, pkg);
}
} catch(e) {
// socke.io would broken if uncaugth the exception
logger.error('rpc server process message error: %j', e.stack);
//add code
throw e;
}
});
process.on('uncaughtException', function (err) {
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions