mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-22 22:35:27 +00:00
add a bit more messaging to errors in account upsert
This commit is contained in:
parent
d6f5671efb
commit
bb3b4807ff
1 changed files with 2 additions and 0 deletions
|
@ -145,6 +145,7 @@ func (a *api) upsertAccountsHandler(w http.ResponseWriter, r *http.Request) {
|
|||
rac := a.reddit.NewAuthenticatedClient(reddit.SkipRateLimiting, acc.RefreshToken, acc.AccessToken)
|
||||
tokens, err := rac.RefreshTokens(ctx)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("failed to refresh tokens: %w", err)
|
||||
a.errorResponse(w, r, 422, err)
|
||||
return
|
||||
}
|
||||
|
@ -158,6 +159,7 @@ func (a *api) upsertAccountsHandler(w http.ResponseWriter, r *http.Request) {
|
|||
me, err := rac.Me(ctx)
|
||||
|
||||
if err != nil {
|
||||
err := fmt.Errorf("failed to fetch user info: %w", err)
|
||||
a.errorResponse(w, r, 422, err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue