generated from nhcarrigan/template
chore: audit frontend error reporting to exclude expected behaviours #79
@@ -1224,9 +1224,12 @@ export const GameProvider = ({
|
|||||||
) {
|
) {
|
||||||
signatureReference.current = null;
|
signatureReference.current = null;
|
||||||
localStorage.removeItem("elysium_save_signature");
|
localStorage.removeItem("elysium_save_signature");
|
||||||
} else {
|
|
||||||
logError("auto_save", error_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Network failures during background auto-save are expected on
|
||||||
|
* flaky connections — the next tick will retry, so no telemetry needed
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1254,10 +1257,9 @@ export const GameProvider = ({
|
|||||||
}
|
}
|
||||||
await reloadReference.current();
|
await reloadReference.current();
|
||||||
}).
|
}).
|
||||||
catch((error_: unknown) => {
|
catch(() => {
|
||||||
logError("auto_prestige", error_);
|
|
||||||
|
|
||||||
/* Silently ignore — will retry next tick */
|
/* Silently ignore — eligibility is re-checked every tick */
|
||||||
}).
|
}).
|
||||||
finally(() => {
|
finally(() => {
|
||||||
isAutoPrestigingReference.current = false;
|
isAutoPrestigingReference.current = false;
|
||||||
@@ -1307,11 +1309,18 @@ export const GameProvider = ({
|
|||||||
});
|
});
|
||||||
}).
|
}).
|
||||||
catch((error_: unknown) => {
|
catch((error_: unknown) => {
|
||||||
logError("auto_boss", error_);
|
|
||||||
const message
|
const message
|
||||||
= error_ instanceof Error
|
= error_ instanceof Error
|
||||||
? error_.message
|
? error_.message
|
||||||
: String(error_);
|
: String(error_);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "Boss is not currently available" is an expected race condition
|
||||||
|
* in the tick loop — suppress telemetry for this case only
|
||||||
|
*/
|
||||||
|
if (message !== "Boss is not currently available") {
|
||||||
|
logError("auto_boss", error_);
|
||||||
|
}
|
||||||
setAutoBossError(message);
|
setAutoBossError(message);
|
||||||
setState((previous) => {
|
setState((previous) => {
|
||||||
if (previous === null) {
|
if (previous === null) {
|
||||||
@@ -1709,7 +1718,6 @@ export const GameProvider = ({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const startExploration = useCallback(async(areaId: string) => {
|
const startExploration = useCallback(async(areaId: string) => {
|
||||||
try {
|
|
||||||
const response = await startExplorationApi({ areaId });
|
const response = await startExplorationApi({ areaId });
|
||||||
setState((previous) => {
|
setState((previous) => {
|
||||||
if (previous?.exploration === undefined) {
|
if (previous?.exploration === undefined) {
|
||||||
@@ -1731,15 +1739,10 @@ export const GameProvider = ({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} catch (error_: unknown) {
|
|
||||||
logError("start_exploration", error_);
|
|
||||||
throw error_;
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const collectExploration = useCallback(
|
const collectExploration = useCallback(
|
||||||
async(areaId: string): Promise<ExploreCollectResponse> => {
|
async(areaId: string): Promise<ExploreCollectResponse> => {
|
||||||
try {
|
|
||||||
const result = await collectExplorationApi({ areaId });
|
const result = await collectExplorationApi({ areaId });
|
||||||
setState((previous) => {
|
setState((previous) => {
|
||||||
if (previous?.exploration === undefined) {
|
if (previous?.exploration === undefined) {
|
||||||
@@ -1813,10 +1816,6 @@ export const GameProvider = ({
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
} catch (error_: unknown) {
|
|
||||||
logError("collect_exploration", error_);
|
|
||||||
throw error_;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
@@ -1960,11 +1959,20 @@ export const GameProvider = ({
|
|||||||
});
|
});
|
||||||
setBattleResult({ bossName: boss.name, result: result });
|
setBattleResult({ bossName: boss.name, result: result });
|
||||||
} catch (error_: unknown) {
|
} catch (error_: unknown) {
|
||||||
logError("challenge_boss", error_);
|
const bossErrorMessage
|
||||||
setBossError(
|
= error_ instanceof Error
|
||||||
error_ instanceof Error
|
|
||||||
? error_.message
|
? error_.message
|
||||||
: "Failed to challenge boss",
|
: "Failed to challenge boss";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "Boss is not currently available" is an expected server rejection
|
||||||
|
* (race condition between UI state and server state) — suppress telemetry
|
||||||
|
*/
|
||||||
|
if (bossErrorMessage !== "Boss is not currently available") {
|
||||||
|
logError("challenge_boss", error_);
|
||||||
|
}
|
||||||
|
setBossError(
|
||||||
|
bossErrorMessage,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}, [ forceSync ]);
|
}, [ forceSync ]);
|
||||||
|
|||||||
Reference in New Issue
Block a user