{"record":{"id":"77eb908424605ba3","repo":"louislam/uptime-kuma","slug":"please-input-all-fields","errorCode":null,"errorMessage":"Please input all fields","messagePattern":"Please input all fields","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"server/socket-handlers/status-page-socket-handler.js","lineNumber":445,"sourceCode":"\n            callback({\n                ok: false,\n                msg: error.message,\n            });\n        }\n    });\n\n    // Add a new status page\n    socket.on(\"addStatusPage\", async (title, slug, callback) => {\n        try {\n            checkLogin(socket);\n\n            title = title?.trim();\n            slug = slug?.trim();\n\n            // Check empty\n            if (!title || !slug) {\n                throw new Error(\"Please input all fields\");\n            }\n\n            // Make sure slug is string\n            if (typeof slug !== \"string\") {\n                throw new Error(\"Slug -Accept string only\");\n            }\n\n            // lower case only\n            slug = slug.toLowerCase();\n\n            checkSlug(slug);\n\n            let statusPage = R.dispense(\"status_page\");\n            statusPage.slug = slug;\n            statusPage.title = title;\n            statusPage.theme = \"auto\";\n            statusPage.icon = \"\";\n            statusPage.autoRefreshInterval = 300;","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/socket-handlers/status-page-socket-handler.js#L427-L463","documentation":"Thrown by the addStatusPage handler when title or slug is empty after trimming. Both fields are required to create a new status page; the check runs right after checkLogin and the trim() of each value.","triggerScenarios":"Client emits 'addStatusPage' (title, slug, callback) with title and/or slug missing, empty, or whitespace-only.","commonSituations":"User clicks create without filling the form; one field is pasted as whitespace; client sends null/undefined for either argument.","solutions":["Supply non-empty trimmed title and slug values before emitting addStatusPage.","Disable the create button until both fields pass client-side validation.","Remember slug must also satisfy checkSlug (alphanumeric with single hyphens) afterwards."],"exampleFix":"// before\nsocket.emit(\"addStatusPage\", \"\", \"\", cb);\n// after\nsocket.emit(\"addStatusPage\", \"Main\", \"main\", cb);","handlingStrategy":"validation","validationCode":"title = (title || \"\").trim();\nslug = (slug || \"\").trim();\nif (!title || !slug) throw new Error(\"Please input all fields\");\nsocket.emit(\"addStatusPage\", title, slug, cb);","typeGuard":"function hasTitleAndSlug(title, slug) {\n  return typeof title === \"string\" && typeof slug === \"string\"\n    && title.trim() !== \"\" && slug.trim() !== \"\";\n}","tryCatchPattern":"try { await emitAsync(\"addStatusPage\", title, slug, cb); }\ncatch (e) { if (/input all fields/.test(e.message)) flagBoth(); else throw e; }","preventionTips":["Disable create until both fields are non-empty.","Trim inputs before sending.","Remember slug must also pass checkSlug."],"tags":["status-page","validation","create","socket-io"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}