Skip to content

Commit

Permalink
fix: startup without .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 committed Jul 7, 2024
1 parent 023090c commit d917ffc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ pub mod built_info {

#[tokio::main]
async fn main() {
dotenv().expect("could not read env file");
match dotenv() {
Ok(_) => {}
Err(err) => println!("Could not read .env file: {}", err),
};
env_logger::init();

info!(
Expand Down Expand Up @@ -109,8 +112,8 @@ async fn get_chain_backend() -> Arc<Box<dyn ChainBackend + Send + Sync>> {
.expect("ELEMENTS_PORT invalid"),
env::var("ELEMENTS_COOKIE").expect("ELEMENTS_COOKIE must be set"),
)
.connect()
.await
.connect()
.await
{
Ok(client) => Box::new(client),
Err(err) => {
Expand Down

0 comments on commit d917ffc

Please sign in to comment.