Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: lib/MT/Component.pm
- ===================================================================
- --- lib/MT/Component.pm (revision 3104)
- +++ lib/MT/Component.pm (working copy)
- @@ -152,8 +152,19 @@
- $path = File::Spec->catfile( $c->path, $file );
- return unless -f $path;
- require YAML::Tiny;
- - my $y = eval { YAML::Tiny->read($path) }
- - or die "Error reading $path: " . (YAML::Tiny->errstr||$@||$!);
- + my $y = eval { YAML::Tiny->read($path) };
- + if (!$y) {
- + if ($c->isa('MT::Plugin')) {
- + my $msg = sprintf "PLUGIN Error reading %s: %s", $path, (YAML::Tiny->errstr||$@||$!);
- + print STDERR $msg."\n";
- + $c->error($msg);
- + return 0;
- + }
- + else {
- + die "Error reading $path: " . (YAML::Tiny->errstr||$@||$!);
- + }
- + }
- +
- if ( ref($y) ) {
- # skip over non-hash elements
Add Comment
Please, Sign In to add comment