Merge lp:~jelmer/brz/launchpadlib-error into lp:brz

Proposed by Jelmer Vernooij on 2019-02-14
Status: Merged
Approved by: Jelmer Vernooij on 2019-02-14
Approved revision: 7283
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/launchpadlib-error
Merge into: lp:brz
Diff against target: 25 lines (+11/-1)
1 file modified
breezy/plugins/launchpad/lp_api.py (+11/-1)
To merge this branch: bzr merge lp:~jelmer/brz/launchpadlib-error
Reviewer Review Type Date Requested Status
Martin Packman Approve on 2019-02-14
Saša Janiška 2019-02-14 Pending
Review via email: mp+363218@code.launchpad.net

Commit message

Add clearer error when launchpadlib is missing.

Description of the change

Add clearer error when launchpadlib is missing.

To post a comment you must log in.
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/launchpad/lp_api.py'
2--- breezy/plugins/launchpad/lp_api.py 2019-01-28 21:00:58 +0000
3+++ breezy/plugins/launchpad/lp_api.py 2019-02-14 19:09:45 +0000
4@@ -45,10 +45,20 @@
5 )
6 from ...i18n import gettext
7
8+
9+class LaunchpadlibMissing(errors.DependencyNotPresent):
10+
11+ _fmt = ("launchpadlib is required for Launchpad API access. "
12+ "Please install the launchpadlib package.")
13+
14+ def __init__(self, e):
15+ super(LaunchpadlibMissing, self).__init__(
16+ 'launchpadlib', e)
17+
18 try:
19 import launchpadlib
20 except ImportError as e:
21- raise errors.DependencyNotPresent('launchpadlib', e)
22+ raise LaunchpadlibMissing(e)
23
24 from launchpadlib.launchpad import (
25 Launchpad,

Subscribers

People subscribed via source and target branches