This is driving me crazy. I have the code below and when I run it, I only have debug-1
print. If I ment out the where declaration I get debug-1
and debug-2
to print.
console.log( 'debug-1' )
var where = {
pound_id: studypound_id,
species: {
"like": ( species + "*" )
},
study_start: {
"<=": study.study_start
},
study_start: {
">=": threeYearsBeforeStudy
}
}
console.log( 'debug-2' )
Super peculiar. I have this block inside a promise, but I'm sure that shouldn't be an issue.
This is driving me crazy. I have the code below and when I run it, I only have debug-1
print. If I ment out the where declaration I get debug-1
and debug-2
to print.
console.log( 'debug-1' )
var where = {
pound_id: study.pound_id,
species: {
"like": ( species + "*" )
},
study_start: {
"<=": study.study_start
},
study_start: {
">=": threeYearsBeforeStudy
}
}
console.log( 'debug-2' )
Super peculiar. I have this block inside a promise, but I'm sure that shouldn't be an issue.
Share Improve this question edited Apr 6, 2016 at 20:46 Anthony 14.3k14 gold badges65 silver badges86 bronze badges asked Apr 6, 2016 at 18:08 user3221132user3221132 4- so, uh, why haven't you included any errors? – Kevin B Commented Apr 6, 2016 at 18:10
-
2
This is why you should always, always, append a
.catch
handler to every. single. promise. – Jared Smith Commented Apr 6, 2016 at 18:15 -
2
study
,species
andthreeYearsBeforeStudy
are not declared. – Felix Kling Commented Apr 6, 2016 at 18:18 - Would appreciate it if you are able to accept my answer if it helped you fix your problem, thanks. – Anthony Commented Apr 6, 2016 at 18:32
1 Answer
Reset to default 9Add the code
process.on('unhandledRejection', console.log.bind(console))
to the top of your node file after your dependencies. That will let you know what is going wrong, it seems you are running into an error with your promise without handling it anywhere.