From eb7ab043ed93e3ccc06837ecac172f2e10013be6 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Fri, 24 Mar 2023 12:48:47 -0400 Subject: [PATCH] check err on subreddit watcher too --- internal/api/watcher.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/api/watcher.go b/internal/api/watcher.go index 0e04273..52cb5e2 100644 --- a/internal/api/watcher.go +++ b/internal/api/watcher.go @@ -115,6 +115,10 @@ func (a *api) createWatcherHandler(w http.ResponseWriter, r *http.Request) { if cwr.Type == "subreddit" || cwr.Type == "trending" { ac := a.reddit.NewAuthenticatedClient(account.AccountID, account.RefreshToken, account.AccessToken) srr, err := ac.SubredditAbout(ctx, cwr.Subreddit) + if err != nil { + a.errorResponse(w, r, 500, err) + return + } if !srr.Public { a.errorResponse(w, r, 403, reddit.ErrSubredditIsPrivate) return