Skip to content

Obsidian plugin crashes when vault path does not exist (DirectoryNotFoundException) #35

@SlamTGK

Description

@SlamTGK

Description:
When a vault path is removed or no longer exists on disk, the Obsidian plugin throws a System.IO.DirectoryNotFoundException instead of ignoring the missing vault. This causes errors in Flow Launcher logs and plugin reload.

Steps to reproduce:

  1. Add an Obsidian vault in plugin settings with a valid folder path.
  2. Delete or move this folder.
  3. Reload the plugin / Flow Launcher.

Expected behavior:
The plugin should skip or warn about missing vault paths instead of crashing.

Actual behavior:
Throws exception and fails to reload vault list.

Exception message:

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\slamt\Desktop\[Дмитрий Лаухин] Obsidian. Полный курс. Тариф Стандарт (2025)\Бонус\Бонус\[SuperSliv.biz] Бонус\[SuperSliv.biz] SecondBrainVault\Second Brain Vault'.
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserFiles(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at Flow.Launcher.Plugin.Obsidian.Models.Vault.GetFiles(Settings settings)
   at Flow.Launcher.Plugin.Obsidian.Models.Vault..ctor(String id, String vaultPath, VaultSetting vaultSetting, Settings settings)
   at Flow.Launcher.Plugin.Obsidian.Services.VaultManager.UpdateVaultList(Settings settings)
   at Flow.Launcher.Plugin.Obsidian.Obsidian.ReloadData()
   at Flow.Launcher.Plugin.Obsidian.Views.SettingsView.SettingsView_OnUnloaded(Object sender, RoutedEventArgs e)
   ...

Environment:

  • Flow Launcher version: 2.0.1
  • OS Version: Windows 11, build 26100.4946
  • Python Path: C:\Python\Python312\pythonw.exe
  • Node Path: C:\Program Files\nodejs\node.exe
  • x64: True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions