From 5466224988864441de7605219f26bc5170c2a747 Mon Sep 17 00:00:00 2001 From: Thijs Walcarius Date: Wed, 12 Jan 2022 15:04:41 +0100 Subject: [PATCH] Improve documentation about spawner error messages --- docs/source/reference/spawners.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/reference/spawners.md b/docs/source/reference/spawners.md index ce39b598..f91ec320 100644 --- a/docs/source/reference/spawners.md +++ b/docs/source/reference/spawners.md @@ -108,6 +108,16 @@ class MySpawner(Spawner): return url ``` +#### Exception handling + +When `Spawner.start` raises an Exception, a message can be passed on to the user via the exception via a `.jupyterhub_html_message` or `.jupyterhub_message` attribute. + +When the Exception has a `.jupyterhub_html_message` attribute, it will be rendered as HTML to the user. + +Alternatively `.jupyterhub_message` is rendered as unformatted text. + +If both attributes are not present, the Exception will be shown to the user as unformatted text. + ### Spawner.poll `Spawner.poll` should check if the spawner is still running.