return proper error if we fail to convert to canonical JSON
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
3d6b499b88
commit
c83acabfb0
1 changed files with 4 additions and 2 deletions
|
@ -814,8 +814,10 @@ impl Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hash and sign
|
// Hash and sign
|
||||||
let mut pdu_json =
|
let mut pdu_json = utils::to_canonical_object(&pdu).map_err(|e| {
|
||||||
utils::to_canonical_object(&pdu).expect("event is valid, we just created it");
|
error!("Failed to convert PDU {:?} to canonical JSON: {}", &pdu, e);
|
||||||
|
Error::bad_database("Failed to convert PDU to canonical JSON.")
|
||||||
|
})?;
|
||||||
|
|
||||||
pdu_json.remove("event_id");
|
pdu_json.remove("event_id");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue