Skip to content

Commit

Permalink
feat: 🥅 handle ErrRecordNotFound to provide additional information …
Browse files Browse the repository at this point in the history
…for clients
  • Loading branch information
Dan6erbond committed Apr 15, 2023
1 parent 15a1142 commit b86ca2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/graph/auth.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package graph

import (
"context"
"errors"
"fmt"

"github.com/dan6erbond/jolt-server/graph/model"
"github.com/dan6erbond/jolt-server/pkg/models"
"gorm.io/gorm"
)

// SignInWithJellyfin is the resolver for the signInWithJellyfin field.
Expand Down Expand Up @@ -72,6 +74,9 @@ func (r *mutationResolver) RefreshTokens(ctx context.Context, refreshToken strin

isValid, err := r.authService.ValidateRefreshToken(_refreshToken)
if err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, fmt.Errorf("refresh token not found")
}
return nil, err
}

Expand Down

0 comments on commit b86ca2e

Please sign in to comment.