Skip to content

Errors are not handled correctly #9

@stephenfin

Description

@stephenfin

Using an invalid state causes an exception

$ git pw patch update 869747 --state=superceded
Traceback (most recent call last):
  File "/home/sfinucan/.local/bin/git-pw", line 11, in <module>
    sys.exit(cli())
  File "/home/sfinucan/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/sfinucan/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/sfinucan/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/sfinucan/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/sfinucan/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/sfinucan/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/sfinucan/.local/lib/python2.7/site-packages/git_pw/patch.py", line 164, in update_cmd
    patch = api.update('patches', patch_id, data)
  File "/home/sfinucan/.local/lib/python2.7/site-packages/git_pw/api.py", line 175, in update
    return put(url, data).json()
  File "/home/sfinucan/.local/lib/python2.7/site-packages/git_pw/api.py", line 100, in put
    LOG.error(exc.response.json()['detail'])
KeyError: 'detail'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions