Permalink
Browse files

Use proper exception code

  • Loading branch information...
1 parent 2617195 commit 10821b6628fcfbdd47c2d600a4bbf065f578713a @cosimo committed Nov 23, 2010
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/Facter/Util/Loader.pm
View
@@ -16,11 +16,13 @@ method load($fact) {
# TODO: would be cool to also run the ".rb" facts
my $filename = $shortname ~ ".pm";
my $module = "Facter::$shortname";
- require $module;
- # or do {
- # warn "Unable to load fact $shortname: $!";
- # return False;
- #};
+ try {
+ require $module;
+ CATCH {
+ warn "Unable to load fact $shortname: $!";
+ return False;
+ }
+ }
return True;

0 comments on commit 10821b6

Please sign in to comment.