From ab707c5ece96f551d9db63541821da549e9c07b7 Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 21 Oct 2026 11:33:45 +0800 Subject: [PATCH] Update storage.js via upload script - 2026-10-21 11:33:44 --- storage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage.js b/storage.js index c26942b..a2c8c6b 100644 --- a/storage.js +++ b/storage.js @@ -8,7 +8,9 @@ const API_BASE = '/api/storage'; export async function storageGet(key) { const res = await fetch(`${API_BASE}/${encodeURIComponent(key)}`); if (res.status === 404) { - throw new Error(`key not found: ${key}`); + const e = new Error(`key not found: ${key}`); + e.notFound = true; // 这个键还没存过数据(正常情况),和"读取失败"区分开 + throw e; } if (!res.ok) { throw new Error(`storage get failed: ${res.status}`);