~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to lib/common/util.py

  • Committer: wagrant
  • Date: 2008-07-14 01:31:14 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:851
Give CGIRequest an exception handler which turns any exception into
HTTP headers. interpret reads these, and raises an IVLEJailError, which
dispatch should eventually look at.

This is now enabled in serveservice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
        self.message = message
48
48
        self.args = (httpcode, message)
49
49
 
 
50
class IVLEJailError(Exception):
 
51
    """
 
52
    This exception indicates an error that occurred inside an IVLE CGI script
 
53
    inside the jail. It should never be raised directly - only by the 
 
54
    interpreter.
 
55
 
 
56
    Information will be retrieved from it, and then treated as a normal
 
57
    error.
 
58
    """
 
59
    def __init__(self, type_str, message, info):
 
60
        self.type_str = type_str
 
61
        self.message = message
 
62
        self.info = info
 
63
 
50
64
def make_path(path):
51
65
    """Given a path relative to the IVLE root, makes the path relative to the
52
66
    site root using conf.root_dir. This path can be used in URLs sent to the