mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 03:37:43 +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)
|
rac := a.reddit.NewAuthenticatedClient(reddit.SkipRateLimiting, acc.RefreshToken, acc.AccessToken)
|
||||||
tokens, err := rac.RefreshTokens(ctx)
|
tokens, err := rac.RefreshTokens(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
err := fmt.Errorf("failed to refresh tokens: %w", err)
|
||||||
a.errorResponse(w, r, 422, err)
|
a.errorResponse(w, r, 422, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -158,6 +159,7 @@ func (a *api) upsertAccountsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
me, err := rac.Me(ctx)
|
me, err := rac.Me(ctx)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
err := fmt.Errorf("failed to fetch user info: %w", err)
|
||||||
a.errorResponse(w, r, 422, err)
|
a.errorResponse(w, r, 422, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue