Skip to content

Commit 4d86322

Browse files
committed
throw error if credentials are missing
1 parent ab27e97 commit 4d86322

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jupyter_drives/manager.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ def __init__(self, config: traitlets.config.Config) -> None:
4444

4545
# initiate aiobotocore session if we are dealing with S3 drives
4646
if self._config.provider == 's3':
47-
if self._config.access_key_id is not None and self._config.secret_access_key is not None:
47+
if self._config.access_key_id and self._config.secret_access_key:
4848
self._s3_clients = {}
4949
self._s3_session = get_session()
50+
else:
51+
raise tornado.web.HTTPError(
52+
status_code= httpx.codes.BAD_REQUEST,
53+
reason="No credentials specified. Please set them in your user jupyter_server_config file.",
54+
)
5055

5156
@property
5257
def base_api_url(self) -> str:

0 commit comments

Comments
 (0)