mirror of
https://github.com/misenhower/splatoon3.ink.git
synced 2026-03-21 17:54:13 -05:00
Improve error logging for data loading and localization
Replace silent error handling with descriptive messages: log HTTP status in i18n locale loading, log response details in data store fetch, and warn on unexpected localization file read errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f45a4654d1
commit
c93854c610
|
|
@ -102,7 +102,10 @@ export class LocalizationProcessor {
|
|||
|
||||
return JSON.parse(result) || {};
|
||||
} catch (e) {
|
||||
//
|
||||
// File doesn't exist yet or is invalid - return empty object
|
||||
if (e.code !== 'ENOENT') {
|
||||
console.warn(`Failed to read localization file ${this.filename}:`, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ async function loadLocale() {
|
|||
let response = await fetch(`/data/locale/${locale}.json`);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error(response);
|
||||
console.error(`Failed to load locale ${locale}: ${response.status} ${response.statusText}`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ function defineEndpointStore(id, endpoint, transform = null) {
|
|||
let response = await fetch(baseUrl + endpoint);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error(response);
|
||||
console.error(`Failed to fetch ${endpoint}: ${response.status} ${response.statusText}`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user