Skip to content

Log localStorage write failures in local_storage_set#8062

Open
rustbasic wants to merge 2 commits intoemilk:mainfrom
rustbasic:patch179
Open

Log localStorage write failures in local_storage_set#8062
rustbasic wants to merge 2 commits intoemilk:mainfrom
rustbasic:patch179

Conversation

@rustbasic
Copy link
Copy Markdown
Contributor

Log localStorage write failures in local_storage_set

Description
This PR improves local_storage_set() logging in eframe/src/web/storage.rs.

It logs:

  • write failures with key and browser error
  • unavailable local storage

This helps diagnose web persistence issues such as QuotaExceededError when localStorage.setItem() fails.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

Preview available at https://egui-pr-preview.github.io/pr/8062-patch179
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

match local_storage() {
Some(storage) => {
if let Err(err) = storage.set_item(key, value) {
log::info!("local_storage_set failed: key={key}, err={err:?}");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log::info!("local_storage_set failed: key={key}, err={err:?}");
log::warn!("local_storage_set failed: key={key}, err={err}");

@emilk emilk added web Related to running Egui on the web exclude from changelog labels Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exclude from changelog web Related to running Egui on the web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants