apigee / apigee/apigeetool-node

API errors not reported?

Open
#39 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
91
Forks
91
PR merge metrics
No merged PRs in 30d

Description

@theganyo or who else this concerns

It looks like the -V or --debug -D flags don't return errors from the API itself. Here's what I'm getting back:

Please report a bug if this causes problems.
Error: Error: Error uploading policy: 400
Error: Error uploading policy: 400
    at Request._callback (/usr/local/lib/node_modules/apigeetool/lib/commands/deployproxy.js:376:18)
    at Request.self.callback (/usr/local/lib/node_modules/apigeetool/node_modules/request/request.js:123:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/apigeetool/node_modules/request/request.js:1047:14)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/apigeetool/node_modules/request/request.js:998:12)
    at emitNone (events.js:72:20)
    at IncomingMessage.emit (events.js:166:7)

Is there an option I'm missing here? At first glance, the error messages don't seem to be printed out the console:

https://github.com/apigee/apigeetool-node/blob/2198cff354e7d220dc839aff24db4b0205e28597/lib/commands/deployproxy.js#L369-L377

Though I haven't done a deep-dive into the code yet. Let me know how I can help. Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/commands/deployproxy.js around lines 369-377 and reproduce the API failure using the -V or --debug -D flags. Trace how the API response is handled during policy upload and verify that the API's error details are reported in the console rather than only the status code and stack trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.