Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/validation/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ var (
// ErrorGuildNotFound will be sent if the requested guild does not exist
// Code: 20004
ErrorGuildNotFound = Error{errors.New("could not find guild")}

// ErrorMaintenanceMode will be sent if there is ongoing maintenance
// Code: 20005
ErrorMaintenanceMode = Error{errors.New("maintenance mode active")}
)

// Code will return the code of the error
Expand Down Expand Up @@ -284,6 +288,8 @@ func (e Error) Code() int {
return 20003
case ErrorGuildNotFound:
return 20004
case ErrorMaintenanceMode:
return 20005
default:
return 0
}
Expand Down
3 changes: 3 additions & 0 deletions src/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ func TestErrors(t *testing.T) {
ErrorGuildNotFound: {
Code: 20004,
},
ErrorMaintenanceMode: {
Code: 20005,
},
}

for err, values := range errs {
Expand Down
2 changes: 1 addition & 1 deletion src/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ func TibiaDataHTMLDataCollector(TibiaDataRequest TibiaDataRequestStruct) (string
if location.Host == "maintenance.tibia.com" {
LogMessage := "maintenance mode detected on tibia.com"
log.Printf("[info] TibiaDataHTMLDataCollector: %s!", LogMessage)
return "", err
return "", validation.ErrorMaintenanceMode
}
fallthrough

Expand Down