Merge lp:~thumper/launchpad/better-errors-for-translate-path into lp:launchpad
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Robert Collins | ||||||||
Approved revision: | no longer in the source branch. | ||||||||
Merged at revision: | 11695 | ||||||||
Proposed branch: | lp:~thumper/launchpad/better-errors-for-translate-path | ||||||||
Merge into: | lp:launchpad | ||||||||
Diff against target: |
86 lines (+29/-8) 2 files modified
lib/lp/code/xmlrpc/codehosting.py (+11/-2) lib/lp/code/xmlrpc/tests/test_codehosting.py (+18/-6) |
||||||||
To merge this branch: | bzr merge lp:~thumper/launchpad/better-errors-for-translate-path | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Robert Collins (community) | release-critical | Approve | |
Launchpad code reviewers | release-critical | Pending | |
Review via email: mp+38178@code.launchpad.net |
Commit message
Catch the CannotHaveLinke
Description of the change
Originally I was wanting to get the nice contextually aware error messages that existed when the bazaar client got full branch names back for official linked branches from the XMLRPC server rather than the +branch/alias that it gets now to enable accessing private official branches and pushing to series branches to create links.
However that isn't possible with the way that bzr and lp communicate with the launchpad transport. Ideally we want to extend bzr to get nicer error messages by having an early smart server message that specifies the branch and read or write needs of the connection.
So... what this branch does is very simple. It catches the CannotHaveLinke
tests:
CodehostingTest
"returns XXX" - that will confuse folk ;)
I sometimes find creating a constant tuple for exceptions useful. You might find it nice here.
caught_errors = (...)
except caught_errors:
...
mainly useful when you want the same set in multiple places.