Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_comment() silently fails if posting to an invalid/inaccessible bug #25

Closed
edmorley opened this issue Sep 25, 2015 · 1 comment
Closed

Comments

@edmorley
Copy link
Contributor

eg:

import bugsy
bz = bugsy.Bugsy(username=REDACTED, api_key=REDACTED)
bug = bugsy.Bug(bugsy=bz, id=111111111111111111)
bug.add_comment("foo")
# No exception was generated

Expected:
Command doesn't silently fail. Instead some instance of BugsyException is raised.

Note that whilst this example manually generates the bug object, the same could happen if a bug was made private after the .get() but before the .add_comment(), or if say the bug comment was too long - which causes Bugzilla to return an error even though the .get() might have succeeded.

@edmorley
Copy link
Contributor Author

There likely needs to be a raise_for_status() wrapped in a try-except converting it to a BugsyException, after the .post() here:

Bugsy/bugsy/bug.py

Lines 271 to 275 in 436ac23

self._bugsy.session.post(
'%s/bug/%s/comment' % (self._bugsy.bugzilla_url,
self._bug['id']),
data={"comment": comment}
)

And similar for #24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant