Burak Gürsoy avatar Burak Gürsoy committed 23e63b4

Better error checking for plist parser

Comments (0)

Files changed (2)

 Revision history for Perl extension Sys::Info::Driver::OSX.
 
+0.7952 Sat Jul 30 23:39:00 2011
+    => Better error checking for plist parser.
+
 0.7951 Thu May 19 01:13:52 2011
     => Use gmtime for parser tests.
     => Another fix for sysctl parser.

lib/Sys/Info/Driver/OSX.pm

 use Capture::Tiny qw( capture );
 use Carp          qw( croak   );
 
-our $VERSION = '0.7951';
+our $VERSION = '0.7952';
 our @EXPORT  = qw(
     fsysctl
     nsysctl
               ? __PACKAGE__->slurp( $thing )
               : $thing;
     require Mac::PropertyList;
-    return Mac::PropertyList::parse_plist( $raw )->as_perl;
+    my $prop = Mac::PropertyList::parse_plist( $raw )
+                    || croak "Unable to parse plist: $thing";
+    return $prop->as_perl;
 }
 
 sub system_profiler {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.