chore(besadii): Improve error messages on parse failure

Change-Id: I3cc4637aca8a940a0fdeca2d8bd6ac620ea384c0
This commit is contained in:
Vincent Ambo 2021-12-06 19:34:48 +03:00 committed by tazjin
parent 8a944484f0
commit c1479a6221

View file

@ -490,14 +490,14 @@ func main() {
if bin == "patchset-created" { if bin == "patchset-created" {
trigger, err := buildTriggerFromPatchsetCreated(cfg) trigger, err := buildTriggerFromPatchsetCreated(cfg)
if err != nil { if err != nil {
log.Crit("failed to parse 'patchset-created' invocation from args") log.Crit(fmt.Sprintf("failed to parse 'patchset-created' invocation from args: %v", err))
os.Exit(1) os.Exit(1)
} }
gerritHookMain(cfg, log, trigger) gerritHookMain(cfg, log, trigger)
} else if bin == "change-merged" { } else if bin == "change-merged" {
trigger, err := buildTriggerFromChangeMerged(cfg) trigger, err := buildTriggerFromChangeMerged(cfg)
if err != nil { if err != nil {
log.Crit("failed to parse 'change-merged' invocation from args") log.Crit(fmt.Sprintf("failed to parse 'change-merged' invocation from args: %v", err))
os.Exit(1) os.Exit(1)
} }
gerritHookMain(cfg, log, trigger) gerritHookMain(cfg, log, trigger)