From 0d172b5f5f152f59b75790b0e433175eddd258ea Mon Sep 17 00:00:00 2001 From: Christine Banek Date: Fri, 26 Mar 2021 15:59:25 -0700 Subject: [PATCH] [DM-29321] Emit response body in case of error --- src/mobu/jupyterclient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mobu/jupyterclient.py b/src/mobu/jupyterclient.py index 1da3287a..d00a9904 100644 --- a/src/mobu/jupyterclient.py +++ b/src/mobu/jupyterclient.py @@ -159,7 +159,8 @@ async def create_kernel(self, kernel_name: str = "LSST") -> str: async with self.session.post(kernel_url, json=body) as r: if r.status != 201: - raise Exception(f"Error {r.status} from {r.url}") + body = await r.text() + raise Exception(f"Error {r.status} from {r.url}: {body}") response = await r.json() return response["id"]