Severity: LOW
Problem
src/routes/+page.svelte lines 165-169 and 181-183: localStorage.getItem() and localStorage.setItem() are guarded by typeof localStorage !== 'undefined' checks but lack try-catch for:
SecurityError: can occur in some Safari private browsing modes
QuotaExceededError: can occur if storage is full
A thrown exception would break the locale detection/save logic and potentially crash the component.
Proposed Solution
Wrap localStorage calls in try-catch:
function getLocale(): string {
try {
return localStorage.getItem(LOCALE_KEY) ?? DEFAULT_LOCALE;
} catch {
return DEFAULT_LOCALE;
}
}
References
Severity: LOW
Problem
src/routes/+page.sveltelines 165-169 and 181-183:localStorage.getItem()andlocalStorage.setItem()are guarded bytypeof localStorage !== 'undefined'checks but lack try-catch for:SecurityError: can occur in some Safari private browsing modesQuotaExceededError: can occur if storage is fullA thrown exception would break the locale detection/save logic and potentially crash the component.
Proposed Solution
Wrap localStorage calls in try-catch:
References
PLAN.mditem Add try-catch around localStorage operations #16