A social RSS reader built on the AT Protocol. glean.at
glean atproto atmosphere rss feed social app
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix incorrect HTTP status codes for client errors

+9 -9
+2 -2
internal/server/annotations_handler.go
··· 114 114 uri, cid, err := client.CreateRecord(ctx, user.DID, atproto.CollectionAnnotation, record) 115 115 if err != nil { 116 116 s.logger.Error("failed to write annotation to PDS", "error", err) 117 - http.Error(w, "failed to write annotation to PDS: "+err.Error(), http.StatusBadGateway) 117 + http.Error(w, "failed to write annotation to PDS: "+err.Error(), http.StatusInternalServerError) 118 118 return 119 119 } 120 120 a.URI = uri ··· 161 161 if ok { 162 162 if delErr := client.DeleteRecord(ctx, user.DID, parsed.Collection, parsed.RKey); delErr != nil { 163 163 s.logger.Error("failed to delete annotation from PDS", "error", delErr) 164 - http.Error(w, "failed to delete annotation from PDS: "+delErr.Error(), http.StatusBadGateway) 164 + http.Error(w, "failed to delete annotation from PDS: "+delErr.Error(), http.StatusInternalServerError) 165 165 return 166 166 } 167 167 }
+2 -2
internal/server/articles_handler.go
··· 286 286 if ok { 287 287 if delErr := client.DeleteRecord(ctx, user.DID, parsed.Collection, parsed.RKey); delErr != nil { 288 288 s.logger.Error("failed to delete like from PDS", "error", delErr) 289 - http.Error(w, "failed to delete like from PDS: "+delErr.Error(), http.StatusBadGateway) 289 + http.Error(w, "failed to delete like from PDS: "+delErr.Error(), http.StatusInternalServerError) 290 290 return 291 291 } 292 292 } ··· 307 307 uri, _, err := client.CreateRecord(ctx, user.DID, atproto.CollectionLike, likeRecord) 308 308 if err != nil { 309 309 s.logger.Error("failed to write like to PDS", "error", err) 310 - http.Error(w, "failed to write like to PDS: "+err.Error(), http.StatusBadGateway) 310 + http.Error(w, "failed to write like to PDS: "+err.Error(), http.StatusInternalServerError) 311 311 return 312 312 } 313 313
+2 -2
internal/server/auth_handler.go
··· 50 50 51 51 did, resolveErr := atproto.ResolveHandle(r.Context(), handle) 52 52 if resolveErr != nil { 53 - s.renderError(w, r, http.StatusBadGateway, "Handle not found", "Could not resolve that handle. Please check and try again.") 53 + s.renderError(w, r, http.StatusBadRequest, "Handle not found", "Could not resolve that handle. Please check and try again.") 54 54 return 55 55 } 56 56 user, createErr := s.dbs.Users.CreateUser(r.Context(), did) ··· 83 83 did, err := atproto.ResolveHandle(r.Context(), handle) 84 84 if err != nil { 85 85 s.logger.Error("failed to resolve handle", "error", err) 86 - s.renderError(w, r, http.StatusBadGateway, "Handle not found", "Could not resolve that handle. Please check and try again.") 86 + s.renderError(w, r, http.StatusBadRequest, "Handle not found", "Could not resolve that handle. Please check and try again.") 87 87 return 88 88 } 89 89
+3 -3
internal/server/feeds_handler.go
··· 164 164 uri, cid, err := client.CreateRecord(r.Context(), user.DID, atproto.CollectionSubscription, record) 165 165 if err != nil { 166 166 s.logger.Error("failed to write subscription to PDS", "error", err) 167 - http.Error(w, "failed to write subscription to PDS: "+err.Error(), http.StatusBadGateway) 167 + http.Error(w, "failed to write subscription to PDS: "+err.Error(), http.StatusInternalServerError) 168 168 return 169 169 } 170 170 subURI = uri ··· 221 221 if ok { 222 222 if delErr := client.DeleteRecord(r.Context(), user.DID, parsed.Collection, parsed.RKey); delErr != nil { 223 223 s.logger.Error("failed to delete subscription from PDS", "error", delErr) 224 - http.Error(w, "failed to delete subscription from PDS: "+delErr.Error(), http.StatusBadGateway) 224 + http.Error(w, "failed to delete subscription from PDS: "+delErr.Error(), http.StatusInternalServerError) 225 225 return 226 226 } 227 227 } ··· 251 251 if ok { 252 252 if delErr := client.DeleteRecord(r.Context(), user.DID, parsed.Collection, parsed.RKey); delErr != nil { 253 253 s.logger.Error("failed to delete subscription from PDS", "error", delErr, "uri", sub.URI.String) 254 - http.Error(w, "failed to delete subscription from PDS: "+delErr.Error(), http.StatusBadGateway) 254 + http.Error(w, "failed to delete subscription from PDS: "+delErr.Error(), http.StatusInternalServerError) 255 255 return 256 256 } 257 257 }