Open rimutaka opened 3 years ago
It was changed to a better unwrap, but is still not ideal.
let html_data = match html::html(&config, url_path, url_query, dev, api_request.headers).await {
Ok(v) => v,
Err(_) => return gw_response("Server Error".to_owned(), 500, 600),
};
There is a difference between ignoring invalid input and returning 404 and recovering from an error and returning out own 5xx.
Panics are easy to track in Lambda monitoring. We should stop returning 500 and leave to the API GW.
If we are to return an error it should be informative to the end user.
Sending an invalid search string from the front end may force the lambda to panic. E.g.
The problem is in handler.rs unwrapping via
expect
:There should be
match
and a meaningful error message returned to the user.