mirror of https://gitlab.com/ngerakines/tavern.git
Handling context canceled errors in avatar.
This commit is contained in:
parent
f5d6c24c72
commit
28a3df182c
|
@ -2,6 +2,7 @@ package web
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
|
@ -34,6 +35,10 @@ func (h handler) avatarPNG(c *gin.Context) {
|
|||
|
||||
readerCloser, length, err := h.svgConverter.Convert(c.Request.Context(), svg)
|
||||
if err != nil {
|
||||
if err == context.Canceled {
|
||||
c.Status(http.StatusOK)
|
||||
return
|
||||
}
|
||||
h.hardFail(c, err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue