lp-propose - API exceptions show an ugly error
Bug #595271 reported by
Robert Collins
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
When the LP API server returns an error - such as
InvalidBranchMe
lp-propose reraises this as a plain Exception
This has two problems:
- it shows a full traceback rather than a one-liner with the detail in .bzr.log
- the actual backtrace on the server, which devs have access too, gets stripped.
So it makes it ugly and hard to debug.
Better to raise a BzrError of some sort - with internal set to false; and include in it the original error stringification so that when there is a traceback accessible it gets shown in .bzr.log
tags: | added: check-for-breezy |
To post a comment you must log in.
For instance, this is the current output from a failed API call: website- community Exception: InvalidBranchMe rgeProposal
lp-propose lp:~ubuntu-website-community/ubuntu-website/light-drupal-theme -R ubuntu-
lp:ubuntu-drupal-theme is already up-to-date.
bzr: ERROR: exceptions.
Traceback (most recent call last): michael/ bzr-2.2b3/ bzrlib/ commands. py", line 909, in exception_ to_return_ code michael/ bzr-2.2b3/ bzrlib/ commands. py", line 1107, in run_bzr michael/ bzr-2.2b3/ bzrlib/ commands. py", line 687, in run_argv_aliases **all_cmd_ args) michael/ bzr-2.2b3/ bzrlib/ commands. py", line 702, in run .run_simple( *args, **kwargs) michael/ bzr-2.2b3/ bzrlib/ cleanup. py", line 122, in run_simple michael/ bzr-2.2b3/ bzrlib/ cleanup. py", line 156, in _do_with_cleanups michael/ bzr-2.2b3/ bzrlib/ plugins/ launchpad/ __init_ _.py", line 345, in run create_ proposal( ) michael/ bzr-2.2b3/ bzrlib/ plugins/ launchpad/ lp_propose. py", line 208, in create_proposal types=review_ types) michael/ bzr-2.2b3/ bzrlib/ plugins/ launchpad/ lp_propose. py", line 185, in call_webservice ''.join( error_lines) ) rgeProposal
File "/home/
return the_callable(*args, **kwargs)
File "/home/
ret = run(*run_argv)
File "/home/
return self.run(
File "/home/
return self._operation
File "/home/
self.cleanups, self.func, *args, **kwargs)
File "/home/
result = func(*args, **kwargs)
File "/home/
proposer.
File "/home/
review_
File "/home/
raise Exception(
Exception: InvalidBranchMe
bzr 2.2b3 on python 2.6.5 (Linux- 2.6.32- 22-generic- i686-with- Ubuntu- 10.04-lucid)
...