mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Log python plugin error.
This commit is contained in:
@@ -46,13 +46,14 @@ namespace Wox.PluginLoader
|
||||
}
|
||||
return r;
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
#if (DEBUG)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
#endif
|
||||
Log.Error(string.Format("Python Plugin {0} query failed: {1}", metadata.Name, e.Message));
|
||||
}
|
||||
|
||||
return new List<Result>();
|
||||
@@ -73,11 +74,19 @@ namespace Wox.PluginLoader
|
||||
|
||||
private string InvokeFunc(string func, params PyObject[] paras)
|
||||
{
|
||||
string json;
|
||||
string json = null;
|
||||
|
||||
IntPtr gs = PythonEngine.AcquireLock();
|
||||
|
||||
PyObject module = PythonEngine.ImportModule(moduleName);
|
||||
if (module == null)
|
||||
{
|
||||
string error = string.Format("Python Invoke failed: {0} doesn't has module {1}",
|
||||
metadata.ExecuteFilePath,moduleName);
|
||||
Log.Error(error);
|
||||
return json;
|
||||
}
|
||||
|
||||
if (module.HasAttr(func))
|
||||
{
|
||||
PyObject res = paras.Length > 0 ? module.InvokeMethod(func, paras) : module.InvokeMethod(func);
|
||||
|
||||
Reference in New Issue
Block a user