dubtrackapi icon indicating copy to clipboard operation
dubtrackapi copied to clipboard

Logging Errors?

Open jcott28 opened this issue 10 years ago • 1 comments

I'm not getting output when the bot js fails. I have the : bot.on('error', function(msg, trace) { console.log("Got an error from the virtual browser: ", msg, trace); }); inside of the bot js file.

But when I try to do some things, which I know fail since the log ceases, I don't know why.

For example, if I were to toss in some jquery into the bot file, it fails as jquery is not loaded (Im guessing). i.e. console.log("I get this message"); $.ajax({ url: "http://my.url.com/chat/add", type: "POST", ... console.log("Nothing processes afterward");

How do you debug such situations?

Side note question: Do you use Ajax in your bot js file (not the dubtrackapi file)? If so, how did you get it imported?

Thanks! Great work thus far.

jcott28 avatar Oct 15 '15 00:10 jcott28

Ajax is really designed to be done in the browser. For node.js it is recommended to use the request library instead of ajax/xmlhttprequest. Here's a tutorial.

atomjack avatar Oct 17 '15 21:10 atomjack