be more specific about errors

This commit is contained in:
Andre Medeiros 2022-06-30 12:11:07 -04:00
parent ce944f92f7
commit 05cb97d412

View file

@ -257,6 +257,7 @@ func (a *api) editWatcherHandler(w http.ResponseWriter, r *http.Request) {
if err != nil {
switch err {
case reddit.ErrSubredditIsPrivate, reddit.ErrSubredditIsQuarantined:
err = fmt.Errorf("error watching %s: %w", lsr, err)
a.errorResponse(w, r, 403, err)
default:
a.errorResponse(w, r, 422, err)