{"record":{"id":"2add3744adc562d8","repo":"deepseek-ai/deepseek-harness","slug":"directory-exists","errorCode":"directory-exists","errorMessage":"${target} already exists","messagePattern":"(.+?) already exists","errorType":"exception","errorClass":"DirectoryPickerError","httpStatus":null,"severity":"error","filePath":"packages/host/directory-picker-browse/src/index.ts","lineNumber":319,"sourceCode":"    // cwd or the current drive.\n    if (!fullyQualified(path)) {\n      throw new DirectoryPickerError('directory-create-failed', path, `cannot create under \"${path}\": not a fully qualified parent path`)\n    }\n    const parent = resolve(path)\n    // The backend owns segment validation (the wire schema also refuses these,\n    // but direct service consumers must hit the same fence).\n    if (name.trim() === '' || name === '.' || name === '..' || /[/\\\\]/.test(name)) {\n      throw new DirectoryPickerError('directory-create-failed', join(parent, name), `\"${name}\" is not a single path segment`)\n    }\n    const target = join(parent, name)\n    try {\n      // Non-recursive: the parent is the directory the browser is showing, so\n      // a missing parent is a real failure, not a level to invent.\n      await mkdir(target)\n      return target\n    } catch (error: unknown) {\n      if (typeof error === 'object' && error !== null && 'code' in error && error.code === 'EEXIST') {\n        throw new DirectoryPickerError('directory-exists', target, `${target} already exists`)\n      }\n      throw new DirectoryPickerError('directory-create-failed', target, `cannot create ${target}: ${messageOf(error)}`)\n    }\n  }\n}\n","sourceCodeStart":301,"sourceCodeEnd":325,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/host/directory-picker-browse/src/index.ts#L301-L325","documentation":"Error \"${target} already exists\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/host/directory-picker-browse/src/index.ts:319 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":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}