Changeset 599


Ignore:
Timestamp:
Jun 13, 2008, 2:58:13 AM (16 years ago)
Author:
price
Message:

send mail on all exceptions

Location:
trunk/packages/sipb-xen-www/code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/main.py

    r598 r599  
    1818    errio = sys.stderr
    1919    if not isinstance(errio, StringIO):
    20         return None
     20        return ''
    2121    sys.stderr = sys.stdout
    2222    errio.seek(0)
     
    121121def error(op, username, fields, err, emsg):
    122122    """Print an error page when a CodeError occurs"""
     123    send_error_mail('xvm error on %s for %s: %s' % (op, username, err),
     124                    'error on %s for %s: %s\n\n%s\n'
     125                    % (op, username, err, emsg))
    123126    d = dict(op=op, user=username, errorMessage=str(err),
    124127             stderr=emsg)
     
    582585def throwError(_, __, ___):
    583586    """Throw an error, to test the error-tracing mechanisms."""
    584     raise RuntimeError("This is a test of the emergency broadcast system.")
     587    raise CodeError("test of the emergency broadcast system")
    585588
    586589mapping = dict(list=listVms,
  • trunk/packages/sipb-xen-www/code/templates/error.tmpl

    r543 r599  
    77
    88#def body
    9 <p>$errorMessage in operation $op.  This shouldn't happen!  Please
    10 email xvm@mit.edu to explain how it happened.  Stderr:</p>
    11 <pre>$stderr</pre>
     9<p>Uh-oh!  We experienced an error.  Sorry about that.  We've gotten
     10mail about it.</p>
     11
     12<p>Feel free to poke us at <tt>xvm@mit.edu</tt> if this bug is
     13consistently biting you and we don't seem to be fixing it.</p>
     14
     15<p>In case you're curious, the gory details are here.</p>
     16
     17<pre>
     18Error on operation $op for user $user: $errorMessage
     19Error output (if any):
     20$stderr
     21</pre>
    1222#end def
Note: See TracChangeset for help on using the changeset viewer.