diff --git a/crates/torii/core/src/engine.rs b/crates/torii/core/src/engine.rs index dcf4918c1a..530e24eb87 100644 --- a/crates/torii/core/src/engine.rs +++ b/crates/torii/core/src/engine.rs @@ -406,7 +406,7 @@ impl Engine

{ for processor in &self.processors.block { processor .process(&mut self.db, self.provider.as_ref(), block_number, block_timestamp) - .await?; + .await? } Ok(()) } @@ -457,7 +457,7 @@ impl Engine

{ || get_selector_from_name(&processor.event_key())? == event.keys[0]) && processor.validate(event) { - processor + if let Err(e) = processor .process( &self.world, &mut self.db, @@ -467,7 +467,10 @@ impl Engine

{ event_id, event, ) - .await?; + .await + { + error!(target: LOG_TARGET, event_name = processor.event_key(), error = %e, "Processing event."); + } } else { let unprocessed_event = UnprocessedEvent { keys: event.keys.iter().map(|k| format!("{:#x}", k)).collect(), diff --git a/crates/torii/core/src/sql.rs b/crates/torii/core/src/sql.rs index 02fe9ccb21..9ecd7d38b8 100644 --- a/crates/torii/core/src/sql.rs +++ b/crates/torii/core/src/sql.rs @@ -304,8 +304,10 @@ impl Sql { } pub async fn model(&self, model: &str) -> Result { - let reader = ModelSQLReader::new(model, self.pool.clone()).await?; - Ok(reader) + match ModelSQLReader::new(model, self.pool.clone()).await { + Ok(reader) => Ok(reader), + Err(e) => Err(anyhow::anyhow!("Failed to get model from db for selector {model}: {e}")), + } } pub async fn entity(&self, model: String, key: FieldElement) -> Result> {