From 8da71e6d954eed7f480dd2a64a81ff4dd11d237e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 2 Mar 2016 12:33:45 +0100 Subject: [PATCH] =?utf8?q?SelfTest=20-=20bessere=20Fehlerbehandlung=20f?= =?utf8?q?=C3=BCr=20Einbinden=20der=20Test-Module?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fehlermeldung an den TaskServer zurückgeben. Fehlermeldung(en) in der Status-E-Mail hinzufügen. --- SL/BackgroundJob/SelfTest.pm | 4 ++++ templates/mail/self_test/status_mail.txt | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/SL/BackgroundJob/SelfTest.pm b/SL/BackgroundJob/SelfTest.pm index 514562590..2f8883339 100644 --- a/SL/BackgroundJob/SelfTest.pm +++ b/SL/BackgroundJob/SelfTest.pm @@ -13,6 +13,8 @@ use FindBin; use SL::DB::AuthUser; use SL::DB::Default; use SL::Common; +use SL::Locale::String qw(t8); +use Carp; use Rose::Object::MakeMethods::Generic ( array => [ @@ -66,6 +68,7 @@ sub run { $self->_send_email; } + croak t8("Unsuccessfully executed:" . join ("\n", $self->errors)) if $self->errors; return 1; } @@ -156,6 +159,7 @@ sub _prepare_report { database => $::auth->client->{dbname}, client => $::auth->client->{name}, path => $FindBin::Bin, + errors => $self->errors, ); my $output; diff --git a/templates/mail/self_test/status_mail.txt b/templates/mail/self_test/status_mail.txt index 7c3d306df..ac83cce8c 100644 --- a/templates/mail/self_test/status_mail.txt +++ b/templates/mail/self_test/status_mail.txt @@ -1,5 +1,10 @@ kivitendo selftest report. +[% IF errors %] + General error(s) have occured. + [% errors %] +[% END %] + Host: [% host %] Path: [% path %] DB: [% database %] -- 2.20.1