fix: redact remaining file and config refusal echoes (#1873)
This commit is contained in:
1 parent
e9a079fcc4
commit
307fe928ac
31 files changed
+415
-51
No files matched your search
@@ -1025,7 +1025,7 @@ export function parseMigrationMap(text) {
|
||||
const blocks = [...text.matchAll(/^```json queue-map\n([\s\S]*?)^```$/gm)];
|
||||
if (blocks.length !== 1) throw refuse("the migration map must hold exactly one ```json queue-map block");
|
||||
let map;
|
||||
try { map = JSON.parse(blocks[0][1]); } catch (err) { throw refuse(`the migration map's queue-map block is not JSON: ${err.message}`); }
|
||||
try { map = JSON.parse(blocks[0][1]); } catch { throw refuse(`the migration map's queue-map block is not JSON`); }
|
||||
keysExactly(map, ["rows", "retired", "highWater"], "migration map");
|
||||
if (!Array.isArray(map.rows)) throw refuse("migration map rows must be a list");
|
||||
map.rows.forEach((r) => {
|
||||
@@ -1126,7 +1126,7 @@ export function loadDoc(bytes) {
|
||||
throw refuse("queue.json is not valid UTF-8");
|
||||
}
|
||||
let doc;
|
||||
try { doc = JSON.parse(text); } catch (err) { throw refuse(`queue.json is not JSON: ${err.message}`); }
|
||||
try { doc = JSON.parse(text); } catch { throw refuse(`queue.json is not JSON`); }
|
||||
keysExactly(doc, DOC_KEYS, "queue.json");
|
||||
if (serialize(doc) !== text) throw refuse("queue.json does not re-serialize byte for byte (a hand edit?)");
|
||||
if (doc.version !== VERSION) throw refuse(`queue.json version ${doc.version} is not ${VERSION}`);
|
||||
|
||||
Reference in new issue
Block a user