Hi Colin,
I want to develop a patch for lotide and hitide to fix the following thing:
If I want to "Add by ID" a community and use "1" as a query, I get a 500
Internal server error in hitide.
The API returns a lotide::Error::InternalStrStatic, but hitide gets a
RemoteError((500, "Internal Server Error")).
The error happens because lotide::routes::api::parse_lookup() returns the
error.
I guess that's because hyper does some conversion in between.
I would like to be able to show the user a page indicating that the query was
invalid.
How would you approach this? Where do I have to look for howto return a less
generic error to hitide?
I would love to get some pointers from you for this, so I can develop the
patch on my own, to get to know the codebase better.
--
Matthias
All errors in lotide are eventually represented by the Error struct from
src/main.rs. UserError and RoutingError are the only variants that are
returned to clients, the others are converted to 500. In this case, I
think the best path would be to change route_unstable_actors_lookup to
return a UserError if `parse_lookup` fails. Alternately, maybe it should
just return an empty array in this case since it's basically still a
"not found"
While there are currently cases where hitide sanitizes content, this is
a hold-over from before lotide did sanitization. This should actually be
implemented there instead, and then frontends can trust the API response
as-is
Re: [PATCH] Include cleaned HTML from remote as raw