def make_errordocument(app, global_conf, **kw):
 map = {}
 for (status, redir_loc) in kw.items():
  try:
   status = int(status)
  except ValueError:
   raise ValueError(('Bad status code: %r' % status))
  map[status] = redir_loc
 forwarder = forward(app, map)
 return forwarder

def make_errordocument ( app , global_conf , ** kw ) : map = { } for ( status , redir_loc ) in kw . items ( ) : try : status = int ( status ) except ValueError : raise ValueError ( ( 'Bad status code: %r' % status ) ) map [ status ] = redir_loc forwarder = forward ( app , map ) return forwarder
paste deploy entry point to create a error document wrapper .