Skip to content

Commit

Permalink
Merge pull request #17 from Overmuse/SR/more_sentry_hooks
Browse files Browse the repository at this point in the history
add more entry hooks for sentry
  • Loading branch information
SebRollen authored Apr 23, 2021
2 parents 2a3719e + 522f3cc commit 5139eda
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 21 deletions.
42 changes: 24 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "alpaca-data-relay"
version = "1.1.0"
version = "1.1.1"
authors = ["Sebastian Rollen <[email protected]>"]
edition = "2018"

Expand Down
15 changes: 13 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use anyhow::Result;
use futures::StreamExt;
use kafka_settings::producer;
use rdkafka::producer::FutureRecord;
use sentry_anyhow::capture_anyhow;
use std::time::Duration;
use tracing::{debug, error, info};

Expand Down Expand Up @@ -51,13 +52,23 @@ pub async fn run(settings: Settings) -> Result<()> {
)
.await;
if let Err((e, msg)) = send {
let e = e.into();
capture_anyhow(&e);
error!("Failed to send msg to Kafka: {:?}. Error: {}", msg, e)
}
}
Err(e) => error!("Failed to serialize payload: {:?}. Error: {}", &message, e),
Err(e) => {
let e = e.into();
capture_anyhow(&e);
error!("Failed to serialize payload: {:?}. Error: {}", &message, e)
}
}
}
Err(e) => error!("Failed to receive message from the WebSocket: {}", e),
Err(e) => {
let e = e.into();
capture_anyhow(&e);
error!("Failed to receive message from the WebSocket: {}", e)
}
}
})
.await;
Expand Down

0 comments on commit 5139eda

Please sign in to comment.