Skip to content

Commit 2a7fc47

Browse files
committed
chore: support test
1 parent 7cfb9c8 commit 2a7fc47

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/storage/kv/put.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ async function save(env, key, string) {
3939
await env.DA_CONFIG.put(key, string);
4040
// Validate the content is there
4141
body = await env.DA_CONFIG.get(key);
42-
const object = body ? JSON.parse(body) : null;
43-
console.log('read config via save', key, object?.permissions?.data);
42+
try {
43+
const object = body ? JSON.parse(body) : null;
44+
console.log('read config via save', key, object?.permissions?.data);
45+
} catch (e) {
46+
// ignore
47+
}
4448
status = 201;
4549
} catch {
4650
body = JSON.stringify({ error: 'Couldn\'t parse or save config.' });

0 commit comments

Comments
 (0)