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:
Min RK
2016-02-25 12:02:23 +01:00
parent 6e7fc0574e
commit dd66fe63c0

View File

@@ -93,8 +93,8 @@ class SpawnHandler(BaseHandler):
form_options[key] = [ bs.decode('utf8') for bs in byte_list ]
for key, byte_list in self.request.files.items():
form_options["%s_file"%key] = byte_list
options = user.spawner.options_from_form(form_options)
try:
options = user.spawner.options_from_form(form_options)
yield self.spawn_single_user(user, options=options)
except Exception as e:
self.log.error("Failed to spawn single-user server with form", exc_info=True)