{"record":{"id":"20710f274697ae27","repo":"immich-app/immich","slug":"errormessage-error","errorCode":null,"errorMessage":"errorMessage || error","messagePattern":"errorMessage \\|\\| error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.svelte","lineNumber":114,"sourceCode":"  };\n\n  const handleResolve = async (duplicateId: string, duplicateAssetIds: string[], trashIds: string[]) => {\n    const forceDelete = !featureFlagsManager.value.trash;\n    const shouldConfirmDelete = trashIds.length > 0 && forceDelete;\n\n    return withConfirmation(\n      async () => {\n        const keepAssetIds = duplicateAssetIds.filter((id) => !trashIds.includes(id));\n\n        const response = await resolveDuplicates({\n          duplicateResolveDto: {\n            groups: [{ duplicateId, keepAssetIds, trashAssetIds: trashIds }],\n          },\n        });\n\n        const { success, error, errorMessage } = response[0];\n        if (!success) {\n          throw new Error(errorMessage || error);\n        }\n\n        duplicates = duplicates.filter((duplicate) => duplicate.duplicateId !== duplicateId);\n\n        deletedNotification(trashIds.length);\n        await navigateToIndex(duplicatesIndex);\n      },\n      shouldConfirmDelete ? $t('delete_duplicates_confirmation') : undefined,\n      shouldConfirmDelete ? $t('permanently_delete') : undefined,\n    );\n  };\n\n  const handleStack = async (duplicateId: string, assets: AssetResponseDto[]) => {\n    const assetIds = assets.map((asset) => asset.id);\n    await createStack({ stackCreateDto: { assetIds } });\n    await updateAssets({ assetBulkUpdateDto: { ids: assetIds, duplicateId: null } });\n    duplicates = duplicates.filter((duplicate) => duplicate.duplicateId !== duplicateId);\n    await navigateToIndex(duplicatesIndex);","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/web/src/routes/(user)/utilities/duplicates/[[photos=photos]]/[[assetId=id]]/+page.svelte#L96-L132","documentation":"Thrown by the duplicates resolution UI (Svelte route +page.svelte) when the server's resolveDuplicates call returns success=false for a group. The message is errorMessage || error from the response, so it forwards whatever the backend reported. This is a client-side re-throw to trigger the surrounding error/notification handler.","triggerScenarios":"User clicks resolve-keep/trash in the Duplicates utility; the backend resolveDuplicates RPC returns { success: false, error/errorMessage } for the duplicateId group (e.g. assets no longer present, permission denied, concurrent modification).","commonSituations":"Assets in the duplicate group were deleted or moved between the duplicate-scan job and the user resolving them; permission changes; another client resolved the same group first; backend validation failure.","solutions":["Refresh the duplicates list and retry — the group may have changed.","Inspect the response.error/errorMessage in DevTools for the specific backend reason.","Re-run the duplicate detection job if the list is stale/inconsistent.","Ensure the user has AssetUpdate/AssetDelete permission on all assets in the group."],"exampleFix":"// before\nconst { success, error, errorMessage } = response[0];\nif (!success) throw new Error(errorMessage || error);\n\n// after — clearer user-facing message\nif (!success) throw new Error(errorMessage || error || $t('errors.unable_to_resolve_duplicates'));","handlingStrategy":"try-catch","validationCode":"// re-fetch the group to ensure assets still exist before resolving\nconst group = await getDuplicateGroup(duplicateId);\nif (!group || group.assetIds.some(id => !knownAssets.has(id))) { refreshDuplicates(); return; }","typeGuard":"const isResolveSuccess = (r: { success?: boolean }): boolean => Boolean(r?.success);","tryCatchPattern":"try { await resolveDuplicates({ duplicateResolveDto }); }\ncatch (e) { if (/duplicate/i.test(e.message)) { await refreshDuplicates(); } else throw e; }","preventionTips":["Refresh the duplicates list before resolving if it has been open a while.","Show the backend errorMessage to the user for actionable guidance."],"tags":["duplicates","web","svelte","rpc","client"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}