lp-propose - API exceptions show an ugly error

Bug #595271 reported by Robert Collins
12
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
InvalidBranchMergeProposal
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

Revision history for this message
Robert Collins (lifeless) wrote :

For instance, this is the current output from a failed API call:
lp-propose lp:~ubuntu-website-community/ubuntu-website/light-drupal-theme -R ubuntu-website-community
lp:ubuntu-drupal-theme is already up-to-date.
bzr: ERROR: exceptions.Exception: InvalidBranchMergeProposal

Traceback (most recent call last):
  File "/home/michael/bzr-2.2b3/bzrlib/commands.py", line 909, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/michael/bzr-2.2b3/bzrlib/commands.py", line 1107, in run_bzr
    ret = run(*run_argv)
  File "/home/michael/bzr-2.2b3/bzrlib/commands.py", line 687, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/michael/bzr-2.2b3/bzrlib/commands.py", line 702, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/michael/bzr-2.2b3/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/michael/bzr-2.2b3/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/michael/bzr-2.2b3/bzrlib/plugins/launchpad/__init__.py", line 345, in run
    proposer.create_proposal()
  File "/home/michael/bzr-2.2b3/bzrlib/plugins/launchpad/lp_propose.py", line 208, in create_proposal
    review_types=review_types)
  File "/home/michael/bzr-2.2b3/bzrlib/plugins/launchpad/lp_propose.py", line 185, in call_webservice
    raise Exception(''.join(error_lines))
Exception: InvalidBranchMergeProposal

bzr 2.2b3 on python 2.6.5 (Linux-2.6.32-22-generic-i686-with-Ubuntu-10.04-lucid)
...

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

Here's the error that's referred to.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.