Skip to content

Commit b1d08a8

Browse files
committed
dev: Better errors
1 parent 999b5d0 commit b1d08a8

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pragma-node/src/handlers/onchain/get_publishers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct PublisherEntry {
3131
pub struct Publisher {
3232
pub publisher: String,
3333
pub website_url: String,
34-
pub last_updated_timestamp: u64,
34+
pub last_updated_timestamp: Option<u64>,
3535
pub r#type: u32,
3636
pub nb_feeds: u32,
3737
pub daily_updates: u32,

pragma-node/src/infra/repositories/onchain_repository/publisher.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,12 @@ async fn get_publisher_with_components(
229229
.collect();
230230

231231
// Execute all futures concurrently and collect results
232-
let components = try_join_all(component_futures)
233-
.await
234-
.map_err(|_| InfraError::PublishersNotFound)?;
232+
let components = try_join_all(component_futures).await?;
235233

236234
let last_updated_timestamp = components
237235
.iter()
238236
.map(|component| component.last_updated_timestamp)
239-
.max()
240-
.ok_or(InfraError::PublishersNotFound)?;
237+
.max();
241238

242239
let publisher = Publisher {
243240
publisher: publisher.name.clone(),

0 commit comments

Comments
 (0)