Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Dec 14, 2023
1 parent 88045e1 commit 3618ca5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nicegui/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from starlette.responses import Response

from . import background_tasks, context, core, json, observables
from .logging import log

request_contextvar: contextvars.ContextVar[Optional[Request]] = contextvars.ContextVar('request_var', default=None)

Expand Down Expand Up @@ -46,6 +47,7 @@ def __init__(self, filepath: Path) -> None:
try:
data = json.loads(filepath.read_text()) if filepath.exists() else {}
except Exception:
log.warning(f'Could not load storage file {filepath}')
data = {}
super().__init__(data, on_change=self.backup)

Expand Down

0 comments on commit 3618ca5

Please sign in to comment.