Re: [PATCH 2/2][RFC]Ktest: Use dodie for critial failures

From: Tim Tianyang Chen
Date: Thu Dec 14 2017 - 19:18:54 EST




On 12/14/2017 04:03 PM, Steven Rostedt wrote:
On Tue, 21 Nov 2017 10:53:35 -0800
Tim Tianyang Chen <tianyang.chen@xxxxxxxxxx> wrote:

Users should get emails when the script dies because of a critical failure. Critical
failures are defined as any errors that could terminate the script, via die().

In order to add email support, this patch converts all die() to dodie() except:
* when '-v' is used as an option to get the version of the script.
* in Sig-Int handeler because it's not a fatal error to cancel the script.
* the die() in dodie() itself actually kills the script.
You basically converted all the "die" in the reading of the config file
into "dodie" so that you could email. But since the reading of the
config failed, there's no way to do the email, because that gets set by
the config.

Perhaps some can be converted, but most of these I would say, no.
Right, it shouldn't send emails when it fails to even parse the config. Since the script will yell immediately there is no need to email either.

Thanks,
Tim