Skip to content

Authentication errors could be added to debugging output #1

Description

@hansmbakker

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions