Check error type correctly

This commit is contained in:
rxdn 2023-09-10 19:34:59 +01:00
parent 23b422afe0
commit 538916772a
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ func GetTranscriptHandler(ctx *gin.Context) {
// retrieve ticket messages from bucket // retrieve ticket messages from bucket
messages, err := utils.ArchiverClient.Get(guildId, ticketId) messages, err := utils.ArchiverClient.Get(guildId, ticketId)
if err != nil { if err != nil {
if errors.Is(err, archiverclient.ErrExpired) { if errors.Is(err, archiverclient.ErrNotFound) {
ctx.JSON(404, utils.ErrorStr("Transcript not found")) ctx.JSON(404, utils.ErrorStr("Transcript not found"))
} else { } else {
ctx.JSON(500, utils.ErrorJson(err)) ctx.JSON(500, utils.ErrorJson(err))

View File

@ -55,7 +55,7 @@ func GetTranscriptRenderHandler(ctx *gin.Context) {
// retrieve ticket messages from bucket // retrieve ticket messages from bucket
transcript, err := utils.ArchiverClient.Get(guildId, ticketId) transcript, err := utils.ArchiverClient.Get(guildId, ticketId)
if err != nil { if err != nil {
if errors.Is(err, archiverclient.ErrExpired) { if errors.Is(err, archiverclient.ErrNotFound) {
ctx.JSON(404, utils.ErrorStr("Transcript not found")) ctx.JSON(404, utils.ErrorStr("Transcript not found"))
} else { } else {
ctx.JSON(500, utils.ErrorJson(err)) ctx.JSON(500, utils.ErrorJson(err))