Unhandled "error" event Questrade.emit
Closed this issue · 4 comments
joshk132 commented
I have my package variables up top, then the questrade variables with the
// Wait to login
qt.on('ready', () => {
// Access your account here
qt.getAccounts();
qt.getBalances();
// Get Market quotes
qt.getQuote('MSFT');
// ... etc. See the full documentation for all the calls you can make!
});
Then my routes require, my db connection and my passport config.
My app.js runs fine to the end and shows the server starting but then after 1 second pops this error and shuts down my server.
leanderlee commented
What is the error?
jonathanbell commented
I thought that I had this issue also. It's not super clear on the QT website how to get your token. Perhaps they have changed it recently. @joshk132 make sure you click "New Device" on the API Centre page in order to get your OAuth token. @leanderlee thanks for the package! Nice work 😸
leanderlee commented
You should try to print out the error, that might give a hint. Print out
qt.on(‘error’, ...)
On Thu, Oct 5, 2017 at 9:52 PM Jonathan Bell ***@***.***> wrote:
I also may have this issue.
Error: Uncaught, unspecified "error" event. ([object Object])
at Questrade.emit (events.js:163:17)
My test code:
var Questrade = require('questrade');
var qt = new Questrade('5wGp47vluXGhtObD-cAb6LHMsABbxA');
qt.on('ready', function() {
console.log('logged in!');
qt.getQuotes(['MSFT', 'AAPL', 'BMO'], function(err, quotes) {
if (err) {
console.log('Error!!!', err);
return;
}
console.log(quotes);
});
});
Any ideas?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATHanoDRFKsB0w-SpW0zV4_8Ym6acM4ks5spbIJgaJpZM4PQVyC>
.
--
Leander
jonathanbell commented
See my updated comment on GH. Thanks for this wrapper - playing with it
now.
…On Thu, Oct 5, 2017 at 10:21 PM, Leander ***@***.***> wrote:
You should try to print out the error, that might give a hint. Print out
qt.on(‘error’, ...)
On Thu, Oct 5, 2017 at 9:52 PM Jonathan Bell ***@***.***>
wrote:
> I also may have this issue.
>
> Error: Uncaught, unspecified "error" event. ([object Object])
> at Questrade.emit (events.js:163:17)
>
> My test code:
>
> var Questrade = require('questrade');
> var qt = new Questrade('5wGp47vluXGhtObD-cAb6LHMsABbxA');
>
> qt.on('ready', function() {
>
> console.log('logged in!');
>
> qt.getQuotes(['MSFT', 'AAPL', 'BMO'], function(err, quotes) {
> if (err) {
> console.log('Error!!!', err);
> return;
> }
> console.log(quotes);
> });
>
> });
>
> Any ideas?
>
> —
> You are receiving this because you commented.
>
>
> Reply to this email directly, view it on GitHub
> <#3 (comment)
>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-
auth/AATHanoDRFKsB0w-SpW0zV4_8Ym6acM4ks5spbIJgaJpZM4PQVyC>
> .
>
--
Leander
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABoOd2AFbfsYoVf80Z_igR-WCAmy1FsGks5spbjUgaJpZM4PQVyC>
.
--
Jonathan Bell
http://jonathanbell.ca
jonathanbell.ca@gmail.com