From: Robert 'phaylon' Sedlacek Date: Mon, 18 Jun 2012 21:12:13 +0000 (+0000) Subject: moved error data to __error__ markers X-Git-Tag: v0.001_001~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b69d66e6297550a42ecc2679b264f09f6b8151a;p=scpubgit%2FSystem-Introspector.git moved error data to __error__ markers --- diff --git a/lib/System/Introspector/Probe/Puppet.pm b/lib/System/Introspector/Probe/Puppet.pm index fda3225..811dea0 100644 --- a/lib/System/Introspector/Probe/Puppet.pm +++ b/lib/System/Introspector/Probe/Puppet.pm @@ -32,7 +32,7 @@ sub _gather_resources { return { list => [ map { m{^(\w+)\[(.*)\]$} ? [$1, $2] - : [error => $_]; + : [__error__ => $_]; } @lines ] }; }; } diff --git a/lib/System/Introspector/Probe/Repositories/Git.pm b/lib/System/Introspector/Probe/Repositories/Git.pm index 38e39b9..c416c07 100644 --- a/lib/System/Introspector/Probe/Repositories/Git.pm +++ b/lib/System/Introspector/Probe/Repositories/Git.pm @@ -69,7 +69,7 @@ sub _find_tracking { } } else { - return { error => join "\n", @lines }; + return { __error__ => join "\n", @lines }; } } return { branches => \%branch }; @@ -77,7 +77,7 @@ sub _find_tracking { sub _find_commits { my ($self, $dir, $local, $remote) = @_; - return { error => "No remote" } + return { __error__ => "No remote" } unless defined $remote; local $ENV{GIT_DIR} = $dir; my @lines = lines_from_command @@ -87,7 +87,7 @@ sub _find_commits { sub _find_changes { my ($self, $dir, $local, $remote) = @_; - return { error => "No remote" } + return { __error__ => "No remote" } unless defined $remote; local $ENV{GIT_DIR} = $dir; my @lines = lines_from_command diff --git a/lib/System/Introspector/Probe/Users.pm b/lib/System/Introspector/Probe/Users.pm index 1260120..6c1a82a 100644 --- a/lib/System/Introspector/Probe/Users.pm +++ b/lib/System/Introspector/Probe/Users.pm @@ -43,7 +43,7 @@ sub _gather_crontab { unless ($ok) { return {} if $err =~ m{^no crontab}i; - return { error => $err }; + return { __error__ => $err }; } return { body => $out }; } diff --git a/lib/System/Introspector/Util.pm b/lib/System/Introspector/Util.pm index 99788ef..530f9f9 100644 --- a/lib/System/Introspector/Util.pm +++ b/lib/System/Introspector/Util.pm @@ -44,7 +44,7 @@ sub transform_exceptions (&) { my ($code) = @_; my $result = eval { $code->() }; if (my $error = $@) { - return { error => $error->message } + return { __error__ => $error->message } if is_report_exception $error; die $@; }