From 529adbd348c7a7e096be2bed65e26886b0d39da9 Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Sat, 7 Mar 2020 19:09:24 +0200 Subject: [PATCH] @wip Catch exceptions in run_hooks mehtod --- lib/puma/configuration.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/puma/configuration.rb b/lib/puma/configuration.rb index 838e61731a..eeb31a0cb7 100644 --- a/lib/puma/configuration.rb +++ b/lib/puma/configuration.rb @@ -276,7 +276,16 @@ def load_plugin(name) end def run_hooks(key, arg) - @options.all_of(key).each { |b| b.call arg } + @options.all_of(key).each do |b| + begin + b.call arg + rescue => e + # TODO: logging + # TODO: write tests - unit and integration + puts "WARNING hook #{key} failed with exception" + puts e.full_message + end + end end def self.temp_path