Files
descrybe/apps/web/scripts/list-api-errors.mjs
T
greeneclipse 8580c996c3 Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
2026-08-09 22:47:43 +02:00

24 lines
695 B
JavaScript

import fs from "node:fs";
import path from "node:path";
const root = path.resolve("apps/api/internal/httpapi");
const msgs = new Set();
function walk(dir) {
for (const ent of fs.readdirSync(dir, { withFileTypes: true })) {
const p = path.join(dir, ent.name);
if (ent.isDirectory()) walk(p);
else if (ent.name.endsWith(".go")) {
const s = fs.readFileSync(p, "utf8");
for (const m of s.matchAll(/Error\(w,\s*http\.Status\w+,\s*"([^"]+)"/g)) {
msgs.add(m[1]);
}
for (const m of s.matchAll(/CodedError\(w,\s*http\.Status\w+,\s*"[^"]+",\s*"([^"]+)"/g)) {
msgs.add(m[1]);
}
}
}
}
walk(root);
console.log([...msgs].sort().join("\n"));
console.log("COUNT", msgs.size);