diff options
author | Michael Vetter <jubalh@iodoru.org> | 2019-06-07 11:30:46 +0200 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2019-06-07 11:30:46 +0200 |
commit | cc697de0515bb15149983d08a99e8d2ad210bbb5 (patch) | |
tree | 3f7c292065946a100f5121d885ff3ed6f1f76d9a /src/command/cmd_funcs.c | |
parent | c03f9363902fbea96c8a2d35c945b52b27c3f701 (diff) | |
download | profani-tty-cc697de0515bb15149983d08a99e8d2ad210bbb5.tar.gz |
Improve plugin load/install failure message
In case Python or C plugins are disabled install/load failed silently. Notify the user that we can't load them because profanity was built without support for plugins.
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 999afd10..ae3bda0b 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6904,12 +6904,14 @@ cmd_plugins_load(ProfWin *window, const char *const command, gchar **args) return TRUE; } - gboolean res = plugins_load(args[1]); + GString* error_message = g_string_new(NULL); + gboolean res = plugins_load(args[1], error_message); if (res) { cons_show("Loaded plugin: %s", args[1]); } else { - cons_show("Failed to load plugin: %s", args[1]); + cons_show("Failed to load plugin: %s. %s", args[1], error_message->str); } + g_string_free(error_message, TRUE); return TRUE; } @@ -6946,12 +6948,14 @@ cmd_plugins_reload(ProfWin *window, const char *const command, gchar **args) return TRUE; } - gboolean res = plugins_reload(args[1]); + GString* error_message = g_string_new(NULL); + gboolean res = plugins_reload(args[1], error_message); if (res) { cons_show("Reloaded plugin: %s", args[1]); } else { - cons_show("Failed to reload plugin: %s", args[1]); + cons_show("Failed to reload plugin: %s, %s", args[1], error_message); } + g_string_free(error_message, TRUE); return TRUE; } |