superfaceai / cli

Let AI connect the APIs for you
https://superface.ai
MIT License
22 stars 4 forks source link

[BUG] Unclear error Unexpected response received #324

Closed martyndavies closed 1 year ago

martyndavies commented 1 year ago

When running superface new <provider> "<use case>", if the indexed documentation causes the following error Error: Unexpected response received - unable to parse profile source, the CLI just fails out back to the command line and looks like it "just stopped" and you have to scroll back to see the issue.

Passing -q to the command, does present more detail on screen but it's still unclear what should happen or what the user should do next.

Expected Behavior

As per the experience elsewhere in the app, this should fail with:

Current Behavior

CleanShot 2023-07-11 at 13 51 36

Possible Solution

A generic catch and response for OAS issues would be okay in this instance.

Steps to Reproduce

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. superface prepare https://app.orbit.love/api-docs/v1/swagger.json
  2. superface new orbit "get all members"
  3. View the error response
  4. Run superface new orbit "get all members" -q for a more clear output of the error encountered

Your Environment

Include as many relevant details about the environment you experienced the bug in. Preferably include result of superface --version

Jakub-Vacek commented 1 year ago

So this issue are actually two separate issues. First is incorrect error handling of assertion errors, this was fixed in https://github.com/superfaceai/cli/pull/334 Second one is problem with numeric enum values in Engine - opened PR with possible fix.

Jakub-Vacek commented 1 year ago

This is fixed now.