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

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

  • Committer: William Grant
  • Date: 2009-07-04 11:50:22 UTC
  • mto: (1294.4.2 ui-the-third)
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20090704115022-ibvc1d3sf5yea25y
Display useful NotFound data to admins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
                                 ApplicationRoot(req.config, req.store))
97
97
 
98
98
    try:
99
 
        obj, viewcls, subpath = req.router.resolve(req.uri)
100
 
    except RoutingError:
101
 
        obj, viewcls, subpath = None, None, ()
102
 
 
103
 
    if viewcls is not None:
 
99
        obj, viewcls, subpath = req.router.resolve(req.uri.decode('utf-8'))
104
100
        try:
105
101
            # Instantiate the view, which should be a BaseView class
106
102
            view = viewcls(req, obj)
142
138
        else:
143
139
            req.store.commit()
144
140
            return req.OK
145
 
    else:
146
 
        XHTMLErrorView(req, NotFound()).render(req)
 
141
    except RoutingError, e:
 
142
        if req.user.admin:
 
143
            XHTMLErrorView(req, NotFound('Not found: ' +
 
144
                                         str(e.args))).render(req)
 
145
        else:
 
146
            XHTMLErrorView(req, NotFound()).render(req)
 
147
 
147
148
        return req.OK
148
149
 
149
150
def handle_unknown_exception(req, exc_type, exc_value, exc_traceback):