{"record":{"id":"2ec93a1d1d5f94ff","repo":"Mintplex-Labs/anything-llm","slug":"response-error-failed-to-create-slash-command","errorCode":null,"errorMessage":"response.error || \"Failed to create slash command\"","messagePattern":"response\\.error \\|\\| \"Failed to create slash command\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/models/communityHub.js","lineNumber":223,"sourceCode":"   * @param {Object} data - The slash command data\n   * @param {string} data.name - The name of the command\n   * @param {string} data.description - The description of the command\n   * @param {string} data.command - The actual command text\n   * @param {string} data.prompt - The prompt for the command\n   * @param {string[]} data.tags - Array of tags\n   * @param {string} data.visibility - Either 'public' or 'private'\n   * @returns {Promise<{success: boolean, error: string | null}>}\n   */\n  createSlashCommand: async (data) => {\n    return await fetch(`${API_BASE}/community-hub/slash-command/create`, {\n      method: \"POST\",\n      headers: baseHeaders(),\n      body: JSON.stringify(data),\n    })\n      .then(async (res) => {\n        const response = await res.json();\n        if (!res.ok)\n          throw new Error(response.error || \"Failed to create slash command\");\n        return { success: true, error: null, itemId: response.item?.id };\n      })\n      .catch((e) => ({\n        success: false,\n        error: e.message,\n      }));\n  },\n};\n\nexport default CommunityHub;\n","sourceCodeStart":205,"sourceCodeEnd":234,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/frontend/src/models/communityHub.js#L205-L234","documentation":"Frontend guard in CommunityHub.createSlashCommand: the slash-command create endpoint returned a non-ok status, so the command was not published; the backend's error message is surfaced when present, otherwise 'Failed to create slash command'.","triggerScenarios":"Thrown when creating a slash command via the Community Hub fails.","commonSituations":"Invalid slash command definition or hub connection issue.","solutions":["Validate the slash command name and prompt fields.","Check the Community Hub connection key.","Review the returned error for details."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}