I have some code as listed:
function write_to_orchestrate(data_to_write) {
console.log('more testing');
db.put('musician', '1', '{"test":"test1"}')
.then(function (result) {
res.send(result);
})
.fail(function (err) {
res.send(err);
});
console.log('something');
}
It appears, that even though I have breakpoints on the res.send() function calls in the .then and .fail of the db.put function call it isn't stopping for any of them. However both console.log('more testing'); and console.log('something'); are reached without error.
I'm using Webstorm, but even when I just execute this code regularly with a terminal and text editor it appears that the code for db.put(...) is just being skipped somehow. Any ideas on additional troubleshooting/debugging?
I've also noted that the data source that this call is issuing a put to is also live and accepting commands. Just to be sure I issued several curl commands and gets to insure that the data is going in and coming out just fine.
Here's a video explaining what is going on: http://youtu.be/CKq69z4ml8o
UPDATE #1: I also tried per the suggestion making '{"test":"test1"}' into {"test":"test1"} which seemed like a good idea, still no go.
UPDATE #2: Per @hafthor I tried another suggestion and implemented the code like this to eliminate possible semi-colon issues.
function write_to_orchestrate(data_to_write) {
console.log('more testing');
db.put('musician', '1', {"test":"test1"}).then(function (result){res.send(result);}).fail(function (err) {res.send(err);});
console.log('something');
}
It still didn't but I did find upon running the code and debugging in WebStorm that the code gets to the db.put, but then I try to step into the code and it just goes straight to the .fail, then skips out and ends up at the console.log('something'); line.
Also, another video for some more attempts at getting this to work: http://www.youtube.com/watch?v=rItBhyfG5AY