Lasa is a stateless proxy that generates a RSS or an Atom feed from a Standard.site publication. lasa.anhgelus.world
rss atom atprotocol standard-site atproto
2
fork

Configure Feed

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

refactor(cli): clean handling errors

+10 -3
+10 -3
cmd/lasad/errors.go
··· 13 13 w.WriteHeader(http.StatusBadRequest) 14 14 w.Write([]byte(err.Error())) 15 15 return 16 - } else if errors.Is(err, atproto.ErrHandleNotFound) || errors.Is(err, atproto.ErrDIDNotFound{}) { 17 - w.WriteHeader(http.StatusNotFound) 18 - w.Write([]byte(err.Error())) 16 + } else if errors.Is(err, atproto.ErrHandleNotFound) { 17 + errorNotFound(w, err) 18 + return 19 + } else if e, ok := errors.AsType[atproto.ErrDIDNotFound](err); ok { 20 + errorNotFound(w, e) 19 21 return 20 22 } 21 23 panic(err) 22 24 } 25 + 26 + func errorNotFound(w http.ResponseWriter, err error) { 27 + w.WriteHeader(http.StatusNotFound) 28 + w.Write([]byte(err.Error())) 29 + }