libbux icon indicating copy to clipboard operation
libbux copied to clipboard

Authentication errors could be added to debugging output

Open hansmbakker opened this issue 9 years ago • 0 comments

I tried the library but got an error when running the minimal.js example.

  if (err) throw err;
           ^

Error: Unauthorized
    at Request.callback (C:\repos\stock_notify\node_modules\superagent\lib\node\index.js:626:17)
    at C:\repos\stock_notify\node_modules\superagent\lib\node\index.js:795:18
    at Stream.<anonymous> (C:\repos\stock_notify\node_modules\superagent\lib\node\parsers\json.js:16:7)
    at emitNone (events.js:86:13)
    at Stream.emit (events.js:185:7)
    at Unzip.<anonymous> (C:\repos\stock_notify\node_modules\superagent\lib\node\utils.js:112:12)
    at emitNone (events.js:91:20)
    at Unzip.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)

When inspecting the err object in the callback with a debugger it turned out that first I made a mistake, and the second time the bux api decided that the portfolio call used the access_token too soon.

It would be nice if the library could somehow show those messages in the debugging output?

hansmbakker avatar Dec 30 '16 20:12 hansmbakker