{"record":{"id":"21c47455a5c9de38","repo":"Molunerfinn/PicGo","slug":"toolbox-fix-failed","errorCode":null,"errorMessage":"Toolbox fix failed","messagePattern":"Toolbox fix failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/adapters/toolbox-page.ts","lineNumber":15,"sourceCode":"import { IRPCActionType, IToolboxItemType } from '~/universal/types/enum'\nimport { invokeRPC, sendRPC } from '@/utils/dataSender'\n\nexport const toolboxPageAdapter = {\n  runCheck () {\n    sendRPC(IRPCActionType.TOOLBOX_CHECK)\n  },\n  async fixItem (type: IToolboxItemType) {\n    const result = await invokeRPC<IToolboxCheckRes>(\n      IRPCActionType.TOOLBOX_CHECK_FIX,\n      type\n    )\n\n    if (!result.success) {\n      throw new Error(result.error || 'Toolbox fix failed')\n    }\n\n    return result.data\n  },\n  openFile (path: string) {\n    sendRPC(IRPCActionType.OPEN_FILE, path)\n  },\n  reloadApp () {\n    sendRPC(IRPCActionType.RELOAD_APP)\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/adapters/toolbox-page.ts#L1-L27","documentation":"fixItem throws when the TOOLBOX_CHECK_FIX RPC to the main process returns a failure envelope. The main handler (src/main/events/rpc/routes/toolbox/index.ts:38) looks up a fix handler in toolboxFixMap and awaits it; a thrown error inside a fixer (or a missing handler, which returns undefined that fails normalization) is surfaced as this Error. The literal text is the fallback when result.error is empty.","triggerScenarios":"Calling fixItem(type) for a toolbox item whose type is absent from toolboxFixMap (only fixFileMap and fixClipboardUploadMap are registered, e.g. no fixer exists for proxy items), or when the underlying fix routine (file permission change, clipboard-upload service fix) throws.","commonSituations":"Clicking 'fix' in the Toolbox page for an item that has no automatic fix implemented; the app lacks write permission on the file/shortcuts file being repaired; the clipboard upload service cannot be restarted on the current OS.","solutions":["Check result.error first — the fixer usually sets a specific message; the generic text means the error was swallowed","Confirm the toolbox type has a registered fixer in toolboxFixMap; if not, fix the item manually (e.g. set permissions or proxy settings yourself)","For file-permission fixes, ensure the app has rights to chmod/modify the target file (config dir, shortcuts db)","Re-run the corresponding check (TOOLBOX_CHECK) to confirm the underlying issue still exists before retrying the fix"],"exampleFix":"// before\nconst res = await fixItem('proxy') // no fixer registered -> fails\n// after\nconst FIXABLE = new Set(['upload-clipboard', 'file-permission'] as const)\nif (!FIXABLE.has(type as any)) {\n  showManualFixHint(type)\n  return\n}\nconst res = await fixItem(type)","handlingStrategy":"try-catch","validationCode":"const FIXABLE_TYPES = ['upload-clipboard', 'file-permission']\nif (!FIXABLE_TYPES.includes(type)) {\n  showManualFixInstructions(type)\n  return\n}","typeGuard":"function isFixableType(t: string): t is IToolboxItemType {\n  return t in fixFileMap || t in fixClipboardUploadMap\n}","tryCatchPattern":"try {\n  await fixItem(type)\n} catch (e) {\n  notification.error({ title: 'Toolbox fix failed', body: (e as Error).message })\n}","preventionTips":["Run the check (TOOLBOX_CHECK) first and only offer 'fix' for types with a registered fixer","Ensure the app has filesystem permissions before running permission-type fixes","Show manual instructions when no automatic fixer exists","Surface result.error rather than the generic fallback text"],"tags":["ipc","rpc","toolbox","electron"],"backgroundTag":"rpc-handler-failure","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}