Show a result error instead of popping up dialog

This commit is contained in:
Garulf 2023-11-18 21:45:06 -05:00
parent 57541b351a
commit ab7685e9ea

View file

@ -210,7 +210,18 @@ namespace Flow.Launcher.Core.Plugin
}
catch (Exception e)
{
throw new FlowPluginException(metadata, e);
Result r = new()
{
Title = $"{metadata.Name}: {e.GetType().Name}",
SubTitle = "ERROR: There was an error loading this plugin!",
IcoPath = "Images\\app_error.png",
PluginDirectory = metadata.PluginDirectory,
ActionKeywordAssigned = query.ActionKeyword,
PluginID = metadata.ID,
OriginQuery = query,
Action = _ => { throw new FlowPluginException(metadata, e);}
};
results.Add(r);
}
return results;
}