Skip to content

Commit

Permalink
Add more informative error message when disk is full
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdanny committed Jul 24, 2024
1 parent f37967b commit 59c1960
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jupyter_server/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import mimetypes
import os
import re
import sqlite3
import types
import warnings
from http.client import responses
Expand Down Expand Up @@ -765,6 +766,12 @@ def write_error(self, status_code: int, **kwargs: Any) -> None:
if isinstance(e, HTTPError):
reply["message"] = e.log_message or message
reply["reason"] = e.reason
elif (
isinstance(e, sqlite3.OperationalError)
and e.sqlite_errorcode == sqlite3.SQLITE_FULL
):
reply["message"] = "Disk is full"
reply["reason"] = e.sqlite_errorname
else:
reply["message"] = "Unhandled error"
reply["reason"] = None
Expand Down

0 comments on commit 59c1960

Please sign in to comment.