Skip to content

Error parsing error from Github Enterprise instance #4

Closed
@HenryGessau

Description

Testing against a Github Enterprise instance, an unrecognized error is encountered.

$ python -m dinghy https://github.acme.com/foo/bar
Traceback (most recent call last):
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/cli.py", line 35, in cli
    asyncio.run(coro)
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/digest.py", line 393, in make_digest
    results = await asyncio.gather(*coros)
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/digest.py", line 126, in get_repo_entries
    issue_container, pr_container = await asyncio.gather(
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/digest.py", line 53, in get_repo_issues
    repo, issues = await self.gql.nodes(
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/graphql_helpers.py", line 161, in nodes
    data = await self.execute(query, variables)
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/graphql_helpers.py", line 148, in execute
    _raise_if_error(data)
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/graphql_helpers.py", line 59, in _raise_if_error
    if user_fix_msg := USER_FIXABLE_ERR_TYPES.get(err["type"]):
KeyError: 'type'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/__main__.py", line 7, in <module>
    cli(prog_name="dinghy")
  File "/home/henry/dev/github.com/nedbat/dinghy/venv/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/henry/dev/github.com/nedbat/dinghy/venv/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/henry/dev/github.com/nedbat/dinghy/venv/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/henry/dev/github.com/nedbat/dinghy/venv/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/henry/dev/github.com/nedbat/dinghy/src/dinghy/cli.py", line 43, in cli
    f"Remaining {lrl['resource']} rate limit: "
KeyError: 'resource'

Contents of err from query:

print(json.dumps(err, indent=4))
{
    "path": [
        "fragment issueData",
        "projectNextItems"
    ],
    "extensions": {
        "code": "undefinedField",
        "typeName": "Issue",
        "fieldName": "projectNextItems"
    },
    "locations": [
        {
            "line": 51,
            "column": 3
        }
    ],
    "message": "Field 'projectNextItems' doesn't exist on type 'Issue'"
}

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