opsmill / infrahub-sdk-python

Python SDK to interact with Infrahub
https://www.opsmill.com
Apache License 2.0
3 stars 2 forks source link

bug: infrahubctl generator command "swallows" useful information in error messages #29

Open wvandeun opened 4 months ago

wvandeun commented 4 months ago

Component

Python SDK

Infrahub version

0.12.1

Current Behavior

infrahubctl generator command seems to swallow useful information when you run into some error conditions:

In a large generator script it could be hard to figure out where exactly these conditions happened. Using --debug does not seem to provide more information.

Expected Behavior

Steps to Reproduce

class Generator(InfrahubGenerator): async def generate(self, data: dict) -> None: print(data["invalid key"])

- create a file `generators/testing.gql`
```graphql
query testing($name: String!) {
  BuiltinTag(name__value: $name) {
    edges {
      node {
    name {
      value
    }
      }
    }
  }
}

Additional Information

No response

gmazoyer commented 3 weeks ago

It seems that the first part of this issue has been taken care of when we fixed error handling in infrahubctl. The second part where we have String cannot represent a non-string value error, is something that needs addressing in the backend. This is actually the raw error from the GraphQL API. Should we relocate this issue to the backend repo?

dgarros commented 3 weeks ago

It seems that the first part of this issue has been taken care of when we fixed error handling in infrahubctl. The second part where we have String cannot represent a non-string value error, is something that needs addressing in the backend. This is actually the raw error from the GraphQL API. Should we relocate this issue to the backend repo?

Yes