mirror of https://bitbucket.org/ausocean/av.git
revid-cli: capturing errors from calls to stopRevid
This commit is contained in:
parent
19ae6f1ca6
commit
ae792ac11e
|
@ -75,10 +75,13 @@ func main() {
|
|||
// run revid for the specified duration
|
||||
rv, _, err := startRevid(nil, cfg)
|
||||
if err != nil {
|
||||
cfg.Logger.Log(logger.Fatal, pkg+"failed to start revid", err.Error())
|
||||
cfg.Logger.Log(logger.Fatal, pkg+"failed to start revid", "error", err.Error())
|
||||
}
|
||||
time.Sleep(*runDurationPtr)
|
||||
stopRevid(rv)
|
||||
err = stopRevid(rv)
|
||||
if err != nil {
|
||||
cfg.Logger.Log(logger.Error, pkg+"failed to stop revid before program termination", "error", err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -296,7 +299,11 @@ func run(rv *revid.Revid, cfg revid.Config) error {
|
|||
if vars["mode"] == "Paused" {
|
||||
if !paused {
|
||||
log.Log(logger.Info, pkg+"pausing revid")
|
||||
stopRevid(rv)
|
||||
err = stopRevid(rv)
|
||||
if err != nil {
|
||||
log.Log(logger.Error, pkg+"failed to stop revide", "error", err.Error())
|
||||
continue
|
||||
}
|
||||
paused = true
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue