{"record":{"id":"7196dc7f3438e07e","repo":"different-ai/openwork","slug":"failed-to-create-role-response-status","errorCode":null,"errorMessage":"Failed to create role (${response.status}).","messagePattern":"Failed to create role \\((.+?)\\)\\.","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ee/apps/den-web/app/(den)/dashboard/_providers/org-dashboard-provider.tsx","lineNumber":760,"sourceCode":"  async function createRole(input: { roleName: string; permission: Record<string, string[]> }) {\n    if (!getCurrentAccess().canManageRoles) {\n      throw new Error(\"Only workspace owners and super-admins can manage roles.\");\n    }\n    ensureRoleCanBeAssigned(input.roleName);\n\n    await runMutation(\"create-role\", async () => {\n      ensureActiveOrganizationSelected();\n      const { response, payload } = await requestJson(\n        \"/v1/roles\",\n        {\n          method: \"POST\",\n          body: JSON.stringify(input),\n        },\n        12000,\n      );\n\n      if (!response.ok) {\n        throw getRequestError(payload, response, `Failed to create role (${response.status}).`);\n      }\n    });\n  }\n\n  async function createTeam(input: { name: string; memberIds: string[] }) {\n    if (!getCurrentAccess().canManageTeams) {\n      throw new Error(\"Only workspace admins can manage teams.\");\n    }\n\n    await runMutation(\"create-team\", async () => {\n      ensureActiveOrganizationSelected();\n      const { response, payload } = await requestJson(\n        \"/v1/teams\",\n        {\n          method: \"POST\",\n          body: JSON.stringify(input),\n        },\n        12000,","sourceCodeStart":742,"sourceCodeEnd":778,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/apps/den-web/app/(den)/dashboard/_providers/org-dashboard-provider.tsx#L742-L778","documentation":"Error \"Failed to create role (${response.status}).\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/apps/den-web/app/(den)/dashboard/_providers/org-dashboard-provider.tsx:760 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}