{"record":{"id":"716fcdc93dc8d328","repo":"Mintplex-Labs/anything-llm","slug":"server-error","errorCode":null,"errorMessage":"Server error","messagePattern":"Server error","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/endpoints/workspaces.js","lineNumber":777,"sourceCode":"    [validatedRequest, flexUserRoleValid([ROLES.all])],\n    async (request, response) => {\n      try {\n        const { id } = request.params;\n        const user = await userFromSession(request, response);\n        const validChat = await WorkspaceChats.get({\n          id: Number(id),\n          user_id: user?.id ?? null,\n        });\n        if (!validChat)\n          return response\n            .status(404)\n            .json({ success: false, error: \"Chat not found.\" });\n\n        await WorkspaceChats._update(validChat.id, { include: false });\n        response.json({ success: true, error: null });\n      } catch (e) {\n        console.error(e.message, e);\n        response.status(500).json({ success: false, error: \"Server error\" });\n      }\n    }\n  );\n\n  /** Handles the uploading and embedding in one-call by uploading via drag-and-drop in chat container. */\n  app.post(\n    \"/workspace/:slug/upload-and-embed\",\n    [\n      validatedRequest,\n      flexUserRoleValid([ROLES.admin, ROLES.manager]),\n      handleFileUpload,\n    ],\n    async function (request, response) {\n      try {\n        const { slug = null } = request.params;\n        const user = await userFromSession(request, response);\n        const currWorkspace = multiUserMode(response)\n          ? await Workspace.getWithUser(user, { slug })","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/workspaces.js#L759-L795","documentation":"Catch-all handler in the chat-update endpoint: an exception escaped WorkspaceChats.get/_update (e.g. a database error) after the chat-not-found check passed, and the generic 500 'Server error' body is returned.","triggerScenarios":"Thrown at server/endpoints/workspaces.js:777 when the library encounters an invalid state.","commonSituations":"An unhandled server error occurred in a workspace endpoint.","solutions":["Check server logs for the exception details.","Retry the operation; investigate the logged error if it persists."],"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-14T00:17:10.932Z"}