Merge ~cjwatson/lp-mailman:restore-oops-occurred-fault into lp-mailman:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: aa6e04222c5fda1368a59325fb752e15b8b90e0e
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/lp-mailman:restore-oops-occurred-fault
Merge into: lp-mailman:master
Diff against target: 29 lines (+14/-0)
1 file modified
lib/lp/xmlrpc/faults.py (+14/-0)
Reviewer Review Type Date Requested Status
Ioana Lasc Approve
Review via email: mp+400249@code.launchpad.net

Commit message

Restore lp.xmlrpc.faults.OopsOccurred

Description of the change

I stripped down lp.xmlrpc.faults a bit too enthusiastically; OopsOccurred is still used on an error path.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/xmlrpc/faults.py b/lib/lp/xmlrpc/faults.py
2index af10236..ec66e46 100644
3--- a/lib/lp/xmlrpc/faults.py
4+++ b/lib/lp/xmlrpc/faults.py
5@@ -9,6 +9,7 @@ __all__ = [
6 'BadStatus',
7 'NoSuchPersonWithName',
8 'NoSuchTeamMailingList',
9+ 'OopsOccurred',
10 'UnexpectedStatusReport',
11 ]
12
13@@ -59,3 +60,16 @@ class NoSuchPersonWithName(LaunchpadFault):
14
15 def __init__(self, person_name):
16 LaunchpadFault.__init__(self, person_name=person_name)
17+
18+
19+class OopsOccurred(LaunchpadFault):
20+ """An oops has occurred performing the requested operation."""
21+
22+ error_code = 380
23+ msg_template = (
24+ 'An unexpected error has occurred while %(server_op)s. '
25+ 'Please report a Launchpad bug and quote: %(oopsid)s.')
26+
27+ def __init__(self, server_op, oopsid):
28+ LaunchpadFault.__init__(self, server_op=server_op, oopsid=oopsid)
29+ self.oopsid = oopsid

Subscribers

People subscribed via source and target branches