ErrorString
This commit is contained in:
parent
1e15e2b753
commit
b5b0615018
10
main.go
10
main.go
@ -46,9 +46,10 @@ type ActionConfig struct {
|
||||
OnSuccess []ActionConfig `yaml:"onSuccess"`
|
||||
OnError []ActionConfig `yaml:"onError"`
|
||||
|
||||
Directory *DirectoryConfig `yaml:"-"`
|
||||
Parent *ActionConfig `yaml:"-"`
|
||||
Error error `yaml:"-"`
|
||||
Directory *DirectoryConfig `yaml:"-"`
|
||||
Parent *ActionConfig `yaml:"-"`
|
||||
Error error `yaml:"-"`
|
||||
ErrorString string `yaml:"-"`
|
||||
}
|
||||
|
||||
type DirectoryConfig struct {
|
||||
@ -254,6 +255,9 @@ func runAction(action *ActionConfig, eventInfo notify.EventInfo, ctx actionCtx)
|
||||
if err != nil {
|
||||
add2Ctx(action, ctx, "error", err.Error())
|
||||
action.Error = err
|
||||
if err != nil {
|
||||
action.ErrorString = err.Error()
|
||||
}
|
||||
|
||||
log.Printf("[ ERROR ] path=\"%s\" action=\"%s\" error=\"%s\"", eventInfo.Path(), action.Id, err)
|
||||
for _, aE := range action.OnError {
|
||||
|
Loading…
Reference in New Issue
Block a user