Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
317 stars 67 forks source link

Fix error messages for unknown error types #84

Closed aaron-skydio closed 1 year ago

aaron-skydio commented 2 years ago

At least some of the time, the response can look like:

{'errors': [{'message': 'Parse error on "poopy" (IDENTIFIER) at [1, 1]', 'locations': [{'line': 1, 'column': 1}]}]}

which means the handler code throws with something like:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/.../revup/__main__.py", line 29, in _main
    logging.error("{}: {}".format(error["type"], error["message"]))
KeyError: 'type'

Now you'll get something like:

E: Unknown Error: Parse error on "poopy" (IDENTIFIER) at [1, 1]
W: 1 operations failed!

Not sure if some errors still contain type, or if the GitHub GraphQL API doesn't return that anymore. Either way, handling both cases.

Reviewers: jerry,brian-k Topic: unknown-error-types

aaron-skydio commented 2 years ago

Reviews in this chain: └https://github.com/Skydio/revup/pull/84 Fix error messages for unknown error types

aaron-skydio commented 2 years ago
# head base diff date summary
0 77efc2cb 311ff10d diff Oct 31 13:05 PM 1 file changed, 2 insertions(+), 1 deletion(-)