← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging ~cjwatson/lp-mailman:restore-oops-occurred-fault into lp-mailman:master.

Commit message:
Restore lp.xmlrpc.faults.OopsOccurred

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/lp-mailman/+git/lp-mailman/+merge/400249

I stripped down lp.xmlrpc.faults a bit too enthusiastically; OopsOccurred is still used on an error path.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/lp-mailman:restore-oops-occurred-fault into lp-mailman:master.
diff --git a/lib/lp/xmlrpc/faults.py b/lib/lp/xmlrpc/faults.py
index af10236..ec66e46 100644
--- a/lib/lp/xmlrpc/faults.py
+++ b/lib/lp/xmlrpc/faults.py
@@ -9,6 +9,7 @@ __all__ = [
     'BadStatus',
     'NoSuchPersonWithName',
     'NoSuchTeamMailingList',
+    'OopsOccurred',
     'UnexpectedStatusReport',
     ]
 
@@ -59,3 +60,16 @@ class NoSuchPersonWithName(LaunchpadFault):
 
     def __init__(self, person_name):
         LaunchpadFault.__init__(self, person_name=person_name)
+
+
+class OopsOccurred(LaunchpadFault):
+    """An oops has occurred performing the requested operation."""
+
+    error_code = 380
+    msg_template = (
+        'An unexpected error has occurred while %(server_op)s. '
+        'Please report a Launchpad bug and quote: %(oopsid)s.')
+
+    def __init__(self, server_op, oopsid):
+        LaunchpadFault.__init__(self, server_op=server_op, oopsid=oopsid)
+        self.oopsid = oopsid