Merge pull request #415 from moorereason/bugfix/missing-rid-on-missing-cmd

Add request ID logging on missing command
This commit is contained in:
Adnan Hajdarević 2020-04-25 16:59:21 +02:00 committed by GitHub
commit 9cb199c8b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -569,12 +569,12 @@ func handleHook(h *hook.Hook, rid string, headers, query, payload *map[string]in
}
if err != nil {
log.Printf("unable to locate command: '%s'", h.ExecuteCommand)
log.Printf("[%s] error locating command: '%s'", rid, h.ExecuteCommand)
// check if parameters specified in execute-command by mistake
if strings.IndexByte(h.ExecuteCommand, ' ') != -1 {
s := strings.Fields(h.ExecuteCommand)[0]
log.Printf("use 'pass-arguments-to-command' to specify args for '%s'", s)
log.Printf("[%s] use 'pass-arguments-to-command' to specify args for '%s'", rid, s)
}
return "", err