From: Quentin Smith Date: Tue, 11 Aug 2009 03:40:27 +0000 (-0400) Subject: Update the errortest handler for cherrypy X-Git-Tag: 0.1.0^2~46 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/5b6a2d94cebef6d12c2eaf32c010e3a0a8fbf329?hp=ca9f820b87331d4b76c9fd0b96e5334da1176f99 Update the errortest handler for cherrypy svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2689 --- diff --git a/code/main.py b/code/main.py index 00a79ae..473647f 100755 --- a/code/main.py +++ b/code/main.py @@ -182,6 +182,11 @@ console will suffer artifacts. return {'request': cherrypy.request, 'kwargs': kwargs} helloworld._cp_config['tools.require_login.on'] = False + @cherrypy.expose + def errortest(self): + """Throw an error, to test the error-tracing mechanisms.""" + raise RuntimeError("test of the emergency broadcast system") + class MachineView(View): # This is hairy. Fix when CherryPy 3.2 is out. (rename to # _cp_dispatch, and parse the argument as a list instead of @@ -652,16 +657,11 @@ def admin(username, state, path, fields): newstate.environ = state.environ return handler(username, newstate, path, fields) -def throwError(_, __, ___, ____): - """Throw an error, to test the error-tracing mechanisms.""" - raise RuntimeError("test of the emergency broadcast system") - mapping = dict( modify=modify, unauth=unauthFront, admin=admin, - overlord=admin, - errortest=throwError) + overlord=admin) def printHeaders(headers): """Print a dictionary as HTTP headers."""