Skip to content

Commit 59c1960

Browse files
committed
Add more informative error message when disk is full
1 parent f37967b commit 59c1960

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jupyter_server/base/handlers.py

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import mimetypes
1212
import os
1313
import re
14+
import sqlite3
1415
import types
1516
import warnings
1617
from http.client import responses
@@ -765,6 +766,12 @@ def write_error(self, status_code: int, **kwargs: Any) -> None:
765766
if isinstance(e, HTTPError):
766767
reply["message"] = e.log_message or message
767768
reply["reason"] = e.reason
769+
elif (
770+
isinstance(e, sqlite3.OperationalError)
771+
and e.sqlite_errorcode == sqlite3.SQLITE_FULL
772+
):
773+
reply["message"] = "Disk is full"
774+
reply["reason"] = e.sqlite_errorname
768775
else:
769776
reply["message"] = "Unhandled error"
770777
reply["reason"] = None

0 commit comments

Comments
 (0)