Make it easier to debug inbox errors
This commit is contained in:
parent
ef815a436b
commit
d604b62917
@ -114,8 +114,8 @@ pub trait Inbox {
|
|||||||
"Create" => {
|
"Create" => {
|
||||||
let act: Create = serde_json::from_value(act.clone())?;
|
let act: Create = serde_json::from_value(act.clone())?;
|
||||||
match act.object["type"].as_str().unwrap() {
|
match act.object["type"].as_str().unwrap() {
|
||||||
"Article" => self.new_article(conn, act.object_object().unwrap()),
|
"Article" => self.new_article(conn, act.object_object()?),
|
||||||
"Note" => self.new_comment(conn, act.object_object().unwrap(), act.actor_object::<Person>()?.object_props.id_string()?),
|
"Note" => self.new_comment(conn, act.object_object()?, act.actor_object::<Person>()?.object_props.id_string()?),
|
||||||
_ => Err(InboxError::InvalidType)?
|
_ => Err(InboxError::InvalidType)?
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -439,7 +439,7 @@ impl WithInbox for User {
|
|||||||
impl Inbox for User {
|
impl Inbox for User {
|
||||||
fn received(&self, conn: &PgConnection, act: serde_json::Value) {
|
fn received(&self, conn: &PgConnection, act: serde_json::Value) {
|
||||||
if let Err(err) = self.save(conn, act.clone()) {
|
if let Err(err) = self.save(conn, act.clone()) {
|
||||||
println!("Inbox error:\n{}\n{}", err.cause(), err.backtrace());
|
println!("Inbox error:\n{}\n{}\n\nActivity was: {}", err.cause(), err.backtrace(), act.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notifications
|
// Notifications
|
||||||
|
Loading…
Reference in New Issue
Block a user