Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Apr 16, 2024
1 parent 49d80bb commit 20b5688
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion catalyst-gateway/bin/src/cli.rs
Expand Up @@ -66,7 +66,7 @@ impl Cli {

match event_db.get_follower_config().await {
Ok(config) => break config,
Err(err) => error!("Get follower config error: {err}"),
Err(err) => error!("No follower config found, error: {err}"),
}
};

Expand Down
3 changes: 2 additions & 1 deletion catalyst-gateway/bin/src/event_db/config.rs
Expand Up @@ -4,6 +4,7 @@ use std::str::FromStr;
use cardano_chain_follower::Network;
use serde::{Deserialize, Serialize};

use super::error::NotFoundError;
use crate::event_db::EventDB;

/// Representation of the `config` table id fields `id`, `id2`, `id3`
Expand Down Expand Up @@ -98,7 +99,7 @@ impl EventDB {
}

if follower_configs.is_empty() {
Err(anyhow::anyhow!("No config found"))
Err(NotFoundError.into())
} else {
Ok(follower_configs)
}
Expand Down
7 changes: 0 additions & 7 deletions catalyst-gateway/bin/src/event_db/error.rs
@@ -1,13 +1,6 @@
//! Database Errors

use bb8::RunError;

/// DB not found error
#[derive(thiserror::Error, Debug, PartialEq, Eq)]
#[error("Cannot find this item")]
pub(crate) struct NotFoundError;

/// DB connection timeout error
#[derive(thiserror::Error, Debug)]
#[error("Connection to DB timed out")]
pub(crate) struct TimedOutError(#[from] RunError<tokio_postgres::Error>);

0 comments on commit 20b5688

Please sign in to comment.