{"record":{"id":"649436f4be22d8c9","repo":"diegosouzapw/OmniRoute","slug":"failedremovemodelfromdatabase","errorCode":null,"errorMessage":"failedRemoveModelFromDatabase","messagePattern":"failedRemoveModelFromDatabase","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/app/(dashboard)/dashboard/providers/[id]/components/CompatibleModelsSection.tsx","lineNumber":333,"sourceCode":"      console.error(\"Error importing models:\", error);\n      notify.error(t(\"failedImportModelsTryAgain\"));\n    } finally {\n      setImporting(false);\n    }\n  };\n\n  const canImport = connections.some((conn) => conn.isActive !== false);\n\n  // Handle delete: remove from both alias and customModels DB\n  const handleDeleteModel = async (modelId: string, alias?: string | null) => {\n    try {\n      // Remove from customModels DB\n      const res = await fetch(\n        `/api/provider-models?provider=${encodeURIComponent(providerStorageAlias)}&model=${encodeURIComponent(modelId)}`,\n        { method: \"DELETE\" }\n      );\n      if (!res.ok) {\n        throw new Error(t(\"failedRemoveModelFromDatabase\"));\n      }\n      // Also delete the alias\n      if (alias) {\n        await onDeleteAlias(alias);\n      }\n      notify.success(t(\"modelRemovedSuccess\"));\n      onModelsChanged?.();\n    } catch (error) {\n      console.error(\"Error deleting model:\", error);\n      notify.error(error instanceof Error ? error.message : t(\"failedDeleteModelTryAgain\"));\n    }\n  };\n\n  return (\n    <div className=\"flex flex-col gap-4\">\n      <p className=\"text-sm text-text-muted\">{description}</p>\n\n      <div className=\"flex items-end gap-2 flex-wrap\">","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/app/(dashboard)/dashboard/providers/[id]/components/CompatibleModelsSection.tsx#L315-L351","documentation":"Error \"failedRemoveModelFromDatabase\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/app/(dashboard)/dashboard/providers/[id]/components/CompatibleModelsSection.tsx:333 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":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}