On Tue, 21 Nov 2017 10:53:35 -0800Right, 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.
Tim Tianyang Chen <tianyang.chen@xxxxxxxxxx> wrote:
Users should get emails when the script dies because of a critical failure. CriticalYou basically converted all the "die" in the reading of the config file
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.
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.