Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #57 from fastly/fgsch/issue_56
Browse files Browse the repository at this point in the history
Ignore error if the logging endpoint is duplicated
  • Loading branch information
fgsch committed Nov 9, 2018
2 parents 1013449 + 8acaff9 commit 322b93a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,18 @@ func FastlyLogging(client fastly.Client, serviceID string, version int, config T
FormatVersion: 2,
MessageType: "blank",
})
if err != nil {

switch {
case err == nil:
Info.Println("Created request logging endpoint: " + config.Weblog.Name)

case strings.Contains(err.Error(), "Duplicate record"):
// nothing

default:
fmt.Print(err)
return false
}
Info.Println("Created request logging endpoint: " + config.Weblog.Name)

// create waf logging endpoint
_, err = client.CreateSyslog(&fastly.CreateSyslogInput{
Expand Down

0 comments on commit 322b93a

Please sign in to comment.