From 53970db33df3e6a5fdbf8ae36bfc2925554a136d Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Mon, 12 Dec 2016 14:37:33 +0100 Subject: [PATCH] TT#6702 do not die on fraud/credidwarning send mail errors * simply print the send mail error occurrences instead of dying to allow the whole list to be processed Change-Id: I82faa2ec863a8fcae8a220c937afcd61f483c0fd (cherry picked from commit 94266a581430e93d0e514b12258c11da31ee90ef) --- bin/ngcp-credit-warning | 5 ++++- bin/ngcp-fraud-auto-lock | 5 ++++- bin/ngcp-fraud-daily-lock | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/ngcp-credit-warning b/bin/ngcp-credit-warning index 3c74e7a..30137ff 100755 --- a/bin/ngcp-credit-warning +++ b/bin/ngcp-credit-warning @@ -140,7 +140,10 @@ sub main { { map { $_ => $balance->{$_} } qw(id cash_balance) }; } if (@contracts) { - send_email($cwarning, \@contracts); + eval { + send_email($cwarning, \@contracts); + }; + print $EVAL_ERROR if $EVAL_ERROR; } } return; diff --git a/bin/ngcp-fraud-auto-lock b/bin/ngcp-fraud-auto-lock index 370e82c..de498ab 100755 --- a/bin/ngcp-fraud-auto-lock +++ b/bin/ngcp-fraud-auto-lock @@ -185,7 +185,10 @@ sub main { if ($event->{interval_lock} > 0) { lock_customer($event, $subscribers); } - send_email($event, $subscribers); + eval { + send_email($event, $subscribers); + }; + print $EVAL_ERROR if $EVAL_ERROR; } return; } diff --git a/bin/ngcp-fraud-daily-lock b/bin/ngcp-fraud-daily-lock index ba38beb..cdb33be 100755 --- a/bin/ngcp-fraud-daily-lock +++ b/bin/ngcp-fraud-daily-lock @@ -185,7 +185,10 @@ sub main { if ($event->{interval_lock} > 0) { lock_customer($event, $subscribers); } - send_email($event, $subscribers); + eval { + send_email($event, $subscribers); + }; + print $EVAL_ERROR if $EVAL_ERROR; } return; }