{"record":{"id":"730406d2e8b357a5","repo":"yorukot/superfile","slug":"s-is-not-a-directory","errorCode":null,"errorMessage":"%s is not a directory","messagePattern":"(.+?) is not a directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/internal/ui/filepanel/update.go","lineNumber":45,"sourceCode":"\t// In case non Absolute path is passed, make sure to resolve it.\n\tpath = utils.ResolveAbsPath(m.Location, path)\n\n\t// Ignore if its the same directory. It prevents resetting of searchBar\n\tif path == m.Location {\n\t\treturn nil\n\t}\n\n\t// NOTE: This could be a configurable feature\n\t// Update the cursor and render status in case we switch back to this.\n\tm.DirectoryRecords[m.Location] = directoryRecord{\n\t\tdirectoryCursor: m.cursor,\n\t\tdirectoryRender: m.renderIndex,\n\t}\n\n\tif info, err := os.Stat(path); err != nil {\n\t\treturn fmt.Errorf(\"%s : no such file or directory, stats err : %w\", path, err)\n\t} else if !info.IsDir() {\n\t\treturn fmt.Errorf(\"%s is not a directory\", path)\n\t}\n\n\t// In case of switching to parent, explicitly set focus.\n\t// This is to handle when there isn't a DirectoryRecord, yet.\n\tif filepath.Dir(m.Location) == path {\n\t\tm.TargetFile = filepath.Base(m.Location)\n\t}\n\t// Switch to \"path\"\n\tm.Location = path\n\n\t// NOTE: We are fetching the cursor and render from cache, but this could become invalid\n\t// in case user deletes some items in the directory via another file manager and then switch back\n\t// Basically this directoryRecords cache can be invalid. On each Update(), on dire change\n\t// we do a element fetch and validate the cursor and render values. But the filepane could\n\t// stay in invalid state till that and operations done before the update may fail\n\tcurDirectoryRecord, hasRecord := m.DirectoryRecords[m.Location]\n\tif hasRecord {\n\t\tm.cursor = curDirectoryRecord.directoryCursor","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/yorukot/superfile/blob/b72f550bc6e75913f48eb49fdd258e1a2df2fe88/src/internal/ui/filepanel/update.go#L27-L63","documentation":"Error \"%s is not a directory\" thrown in yorukot/superfile.","triggerScenarios":"Thrown at src/internal/ui/filepanel/update.go:45 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":"b72f550bc6e75913f48eb49fdd258e1a2df2fe88","analyzedAt":"2026-09-01T04:38:08.254Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}