From d01e61a2672b9a73b39467a16a37e0aac5b7ee40 Mon Sep 17 00:00:00 2001 From: Mark Harrison <mark@omniti.com> Date: Mon, 2 Jun 2008 18:13:29 +0000 Subject: [PATCH] Wrapping the do command in the module reloading code in an eval so any failures in that command (as happens if trying to load a non-existent module when one is specified in the config file) will not crash the program. git-svn-id: https://labs.omniti.com/resmon/trunk@119 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55 --- lib/Resmon/Module.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Resmon/Module.pm b/lib/Resmon/Module.pm index a6f45db..98d2753 100755 --- a/lib/Resmon/Module.pm +++ b/lib/Resmon/Module.pm @@ -92,7 +92,7 @@ sub reload_module { warn @_; }; # eval <$fh>; - do($file); + eval {do($file); die $@ if $@}; return $@ if $@; return $redef; } -- GitLab