This commit is contained in:
Gvidas Juknevičius 2024-03-30 18:29:09 +02:00
parent 79d649ae58
commit 07c246f5f0
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB

View File

@ -38,10 +38,13 @@ pub async fn handler(req: HttpRequest, token: web::Path<String>, body: Bytes, db
return Ok(HttpResponse::BadRequest());
};
let Ok(event) = types::Event::from_raw_json(event_type, json.clone()) else {
log::debug!("Bad request body json");
let event = match types::Event::from_raw_json(event_type, json.clone()) {
Ok(e) => e,
Err(e) => {
log::debug!("Bad request body json: {e}");
log::debug!("{json:?}");
return Ok(HttpResponse::BadRequest());
}
};
match event {