refactor: replace direct error comparison with errors.Is for ErrUserNotFound
This commit is contained in:
parent
6117e6f769
commit
8ebc370a28
@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
@ -22,7 +23,7 @@ func (h *handler) internalSandboxGuest(c *gin.Context) {
|
||||
|
||||
user, err := h.store.GetUserByEmail(c.Request.Context(), sandboxUserEmail)
|
||||
if err != nil {
|
||||
if err == store.ErrUserNotFound {
|
||||
if errors.Is(err, store.ErrUserNotFound) {
|
||||
c.JSON(http.StatusNotFound, gin.H{"error": "sandbox_missing"})
|
||||
return
|
||||
}
|
||||
@ -50,4 +51,3 @@ func (h *handler) internalSandboxGuest(c *gin.Context) {
|
||||
"proxyUuidExpiresAt": expiresAt,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -23,4 +23,3 @@ func isInternalServiceRequest(c *gin.Context) bool {
|
||||
}
|
||||
return token == expected
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user