Mysql Error at call back function in nodejs
up vote
0
down vote
favorite
code:
checkMongoQuery(mqueries,function(data)
message.mongo=data;
checkMySqlQuery(temp,function(data)
if(data.msg==gloabl_vars.messages.success)
message.msg==gloabl_vars.messages.success;
else
message.msg==gloabl_vars.messages.failed;
message.mysql=data;
result(null,message);
);
);
first it will call checkMongoQuery function and then it will execute checkMySqlQuery finction on success of both it will return the result method. at result method it is throwing an error saying that "Rethrown non mysql error".
Please let me know where is the issue in above code. thanks in advance.
error trace:
E:nodeapinode_modulesmysqllibprotocolParser.js:80
throw err; // Rethrow non-MySQL errors
^
Error: Can't set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
at ServerResponse.header (E:nodeapinode_modulesexpresslibresponse.js:76
7:10)
at ServerResponse.send (E:nodeapinode_modulesexpresslibresponse.js:170:
12)
at ServerResponse.json (E:nodeapinode_modulesexpresslibresponse.js:267:
15)
at E:nodeapiapicontrollersappController.js:96:11
at E:nodeapiapimodelsappModel.js:141:10
at Query.<anonymous> (E:nodeapiapimodelsappModel.js:193:9)
at Query.<anonymous> (E:nodeapinode_modulesmysqllibConnection.js:502:10
)
at Query._callback (E:nodeapinode_modulesmysqllibConnection.js:468:16)
[nodemon] app crashed - waiting for file changes before starting...
mysql node.js mongodb express
add a comment |
up vote
0
down vote
favorite
code:
checkMongoQuery(mqueries,function(data)
message.mongo=data;
checkMySqlQuery(temp,function(data)
if(data.msg==gloabl_vars.messages.success)
message.msg==gloabl_vars.messages.success;
else
message.msg==gloabl_vars.messages.failed;
message.mysql=data;
result(null,message);
);
);
first it will call checkMongoQuery function and then it will execute checkMySqlQuery finction on success of both it will return the result method. at result method it is throwing an error saying that "Rethrown non mysql error".
Please let me know where is the issue in above code. thanks in advance.
error trace:
E:nodeapinode_modulesmysqllibprotocolParser.js:80
throw err; // Rethrow non-MySQL errors
^
Error: Can't set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
at ServerResponse.header (E:nodeapinode_modulesexpresslibresponse.js:76
7:10)
at ServerResponse.send (E:nodeapinode_modulesexpresslibresponse.js:170:
12)
at ServerResponse.json (E:nodeapinode_modulesexpresslibresponse.js:267:
15)
at E:nodeapiapicontrollersappController.js:96:11
at E:nodeapiapimodelsappModel.js:141:10
at Query.<anonymous> (E:nodeapiapimodelsappModel.js:193:9)
at Query.<anonymous> (E:nodeapinode_modulesmysqllibConnection.js:502:10
)
at Query._callback (E:nodeapinode_modulesmysqllibConnection.js:468:16)
[nodemon] app crashed - waiting for file changes before starting...
mysql node.js mongodb express
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
code:
checkMongoQuery(mqueries,function(data)
message.mongo=data;
checkMySqlQuery(temp,function(data)
if(data.msg==gloabl_vars.messages.success)
message.msg==gloabl_vars.messages.success;
else
message.msg==gloabl_vars.messages.failed;
message.mysql=data;
result(null,message);
);
);
first it will call checkMongoQuery function and then it will execute checkMySqlQuery finction on success of both it will return the result method. at result method it is throwing an error saying that "Rethrown non mysql error".
Please let me know where is the issue in above code. thanks in advance.
error trace:
E:nodeapinode_modulesmysqllibprotocolParser.js:80
throw err; // Rethrow non-MySQL errors
^
Error: Can't set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
at ServerResponse.header (E:nodeapinode_modulesexpresslibresponse.js:76
7:10)
at ServerResponse.send (E:nodeapinode_modulesexpresslibresponse.js:170:
12)
at ServerResponse.json (E:nodeapinode_modulesexpresslibresponse.js:267:
15)
at E:nodeapiapicontrollersappController.js:96:11
at E:nodeapiapimodelsappModel.js:141:10
at Query.<anonymous> (E:nodeapiapimodelsappModel.js:193:9)
at Query.<anonymous> (E:nodeapinode_modulesmysqllibConnection.js:502:10
)
at Query._callback (E:nodeapinode_modulesmysqllibConnection.js:468:16)
[nodemon] app crashed - waiting for file changes before starting...
mysql node.js mongodb express
code:
checkMongoQuery(mqueries,function(data)
message.mongo=data;
checkMySqlQuery(temp,function(data)
if(data.msg==gloabl_vars.messages.success)
message.msg==gloabl_vars.messages.success;
else
message.msg==gloabl_vars.messages.failed;
message.mysql=data;
result(null,message);
);
);
first it will call checkMongoQuery function and then it will execute checkMySqlQuery finction on success of both it will return the result method. at result method it is throwing an error saying that "Rethrown non mysql error".
Please let me know where is the issue in above code. thanks in advance.
error trace:
E:nodeapinode_modulesmysqllibprotocolParser.js:80
throw err; // Rethrow non-MySQL errors
^
Error: Can't set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
at ServerResponse.header (E:nodeapinode_modulesexpresslibresponse.js:76
7:10)
at ServerResponse.send (E:nodeapinode_modulesexpresslibresponse.js:170:
12)
at ServerResponse.json (E:nodeapinode_modulesexpresslibresponse.js:267:
15)
at E:nodeapiapicontrollersappController.js:96:11
at E:nodeapiapimodelsappModel.js:141:10
at Query.<anonymous> (E:nodeapiapimodelsappModel.js:193:9)
at Query.<anonymous> (E:nodeapinode_modulesmysqllibConnection.js:502:10
)
at Query._callback (E:nodeapinode_modulesmysqllibConnection.js:468:16)
[nodemon] app crashed - waiting for file changes before starting...
mysql node.js mongodb express
mysql node.js mongodb express
edited Nov 9 at 8:46
asked Nov 9 at 8:33
Cherry g
188
188
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222232%2fmysql-error-at-call-back-function-in-nodejs%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown