1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-09 06:41:04 +01:00

fix: redacts can't error anymore

This commit is contained in:
Timo Kösters 2022-02-10 20:59:11 +01:00
parent 9cfef51af3
commit 6602f6114c
No known key found for this signature in database
GPG key ID: 356E705610F626D5
2 changed files with 10 additions and 8 deletions

View file

@ -2147,13 +2147,9 @@ impl Rooms {
.ok_or_else(|| Error::bad_database("PDU ID points to invalid PDU."))?; .ok_or_else(|| Error::bad_database("PDU ID points to invalid PDU."))?;
pdu.redact(reason)?; pdu.redact(reason)?;
self.replace_pdu(&pdu_id, &pdu)?; self.replace_pdu(&pdu_id, &pdu)?;
Ok(())
} else {
Err(Error::BadRequest(
ErrorKind::NotFound,
"Event ID does not exist.",
))
} }
// If event does not exist, just noop
Ok(())
} }
/// Update current membership data. /// Update current membership data.

View file

@ -1593,7 +1593,10 @@ async fn upgrade_outlier_to_timeline_pdu(
soft_fail, soft_fail,
&state_lock, &state_lock,
) )
.map_err(|_| "Failed to add pdu to db.".to_owned())?; .map_err(|e| {
warn!("Failed to add pdu to db: {}", e);
"Failed to add pdu to db.".to_owned()
})?;
// Soft fail, we keep the event as an outlier but don't add it to the timeline // Soft fail, we keep the event as an outlier but don't add it to the timeline
warn!("Event was soft failed: {:?}", incoming_pdu); warn!("Event was soft failed: {:?}", incoming_pdu);
@ -1759,7 +1762,10 @@ async fn upgrade_outlier_to_timeline_pdu(
soft_fail, soft_fail,
&state_lock, &state_lock,
) )
.map_err(|_| "Failed to add pdu to db.".to_owned())?; .map_err(|e| {
warn!("Failed to add pdu to db: {}", e);
"Failed to add pdu to db.".to_owned()
})?;
debug!("Appended incoming pdu."); debug!("Appended incoming pdu.");