From 1c5dc69047c43318e6bbdd7e376b98ac4288af24 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 31 Jul 2021 12:05:48 -0700 Subject: [PATCH] Plugins: die if plugin fails to autoload during start-up --- lib/PBot/Core/Plugins.pm | 6 +++++- lib/PBot/VERSION.pm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/PBot/Core/Plugins.pm b/lib/PBot/Core/Plugins.pm index 681acc7b..3b7339a0 100644 --- a/lib/PBot/Core/Plugins.pm +++ b/lib/PBot/Core/Plugins.pm @@ -53,7 +53,11 @@ sub autoload { $self->{pbot}->{logger}->log(" $plugin\n"); - $plugin_count++ if $self->load($plugin, %conf); + if ($self->load($plugin, %conf)) { + $plugin_count++ + } else { + die "Plugin $plugin failed to autoload. You may remove it from $data_dir/plugin_autoload.\n"; + } } $self->{pbot}->{logger}->log("$plugin_count plugin" . ($plugin_count == 1 ? '' : 's') . " loaded.\n"); diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index a1ad1ade..adf60217 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4331, + BUILD_REVISION => 4332, BUILD_DATE => "2021-07-31", };