Check error type correctly
This commit is contained in:
parent
23b422afe0
commit
538916772a
@ -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))
|
||||||
|
@ -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))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user