mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-09 11:03:00 +00:00
catch exceptions in options_from_form
Allows form validation to be implemented in options_from_form, as well as start.
This commit is contained in:
@@ -93,8 +93,8 @@ class SpawnHandler(BaseHandler):
|
|||||||
form_options[key] = [ bs.decode('utf8') for bs in byte_list ]
|
form_options[key] = [ bs.decode('utf8') for bs in byte_list ]
|
||||||
for key, byte_list in self.request.files.items():
|
for key, byte_list in self.request.files.items():
|
||||||
form_options["%s_file"%key] = byte_list
|
form_options["%s_file"%key] = byte_list
|
||||||
options = user.spawner.options_from_form(form_options)
|
|
||||||
try:
|
try:
|
||||||
|
options = user.spawner.options_from_form(form_options)
|
||||||
yield self.spawn_single_user(user, options=options)
|
yield self.spawn_single_user(user, options=options)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.error("Failed to spawn single-user server with form", exc_info=True)
|
self.log.error("Failed to spawn single-user server with form", exc_info=True)
|
||||||
|
Reference in New Issue
Block a user