Skip to content

Commit

Permalink
more specific error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fbuetler committed Mar 28, 2024
1 parent b27f9d0 commit 19e15b4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/discord/Commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package discord

import (
"fmt"
"github.com/VSETH-GECO/bouncer/pkg/database"
"strings"

"github.com/bwmarrin/discordgo"
log "github.com/sirupsen/logrus"
"strings"

"github.com/VSETH-GECO/bouncer/pkg/database"
)

const (
Expand Down Expand Up @@ -155,7 +157,7 @@ func (d *Discord) handleUserSubcommand(s *discordgo.Session, i *discordgo.Intera
})

if err != nil {
log.WithError(err).Warn("Error during discord reply")
log.WithError(err).Warn("Error during discord reply: 'invalid user query'")
}
return
}
Expand All @@ -181,7 +183,7 @@ func (d *Discord) handleUserSubcommand(s *discordgo.Session, i *discordgo.Intera
})

if err != nil {
log.WithError(err).Warn("Error during discord reply")
log.WithError(err).Warn("Error during discord reply: 'user query failed'")
}
return
}
Expand All @@ -197,7 +199,7 @@ func (d *Discord) handleUserSubcommand(s *discordgo.Session, i *discordgo.Intera
})

if err != nil {
log.WithError(err).Warn("Error during discord reply")
log.WithError(err).Warn("Error during discord reply: 'final result'")
}
}

Expand Down Expand Up @@ -225,7 +227,7 @@ func (d *Discord) handlePatchSubcommand(s *discordgo.Session, i *discordgo.Inter
Type: discordgo.InteractionResponseDeferredMessageUpdate,
})
if err != nil {
log.WithError(err).Warn("Error during discord reply")
log.WithError(err).Warn("Error during discord reply: 'find vlan select'")
}
} else if data.CustomID == "findLogoutBtn" || data.CustomID == "findLoginBtn" || data.CustomID == "findChangeBtn" || data.CustomID == "findCancelBtn" {
var message string
Expand Down Expand Up @@ -313,7 +315,7 @@ func (d *Discord) handlePatchSubcommand(s *discordgo.Session, i *discordgo.Inter
},
})
if err != nil {
log.WithError(err).Warn("Error during discord reply")
log.WithError(err).Warn("Error during discord reply: 'unknown interaction request'")
}
}
}
Expand Down

0 comments on commit 19e15b4

Please sign in to comment.