2020-04-09 18:10:33 +03:00
|
|
|
package workflows
|
|
|
|
|
|
|
|
import (
|
2020-04-12 03:22:00 +03:00
|
|
|
config "github.com/pikami/tiktok-dl/models/config"
|
|
|
|
res "github.com/pikami/tiktok-dl/resources"
|
|
|
|
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
|
|
|
log "github.com/pikami/tiktok-dl/utils/log"
|
2020-04-09 18:10:33 +03:00
|
|
|
)
|
|
|
|
|
2020-04-12 03:22:00 +03:00
|
|
|
// OnWorkflowFail - Function called when workflow fails
|
2020-04-09 18:10:33 +03:00
|
|
|
func OnWorkflowFail(err error, workItem string) {
|
|
|
|
failLogFilePath := config.Config.FailLogFilePath
|
|
|
|
|
|
|
|
if failLogFilePath != "" {
|
|
|
|
fileio.AppendToFile(workItem, failLogFilePath)
|
|
|
|
}
|
|
|
|
|
|
|
|
log.LogErr(res.Error, err.Error())
|
|
|
|
log.LogErr(res.FailedOnItem, workItem)
|
|
|
|
}
|